MySQL: Drop All Triggers from a Database

I got the error “Trigger already exists” error while I was re-importing a MySQL database. A solution to this problem is to create DROP queries for all the Triggers of the database. SELECT Concat('DROP TRIGGER ', Trigger_Name, ';') FROM information_schema.TRIGGERS WHERE TRIGGER_SCHEMA = 'your_database_name'; This will print out the DROP statements for all the triggers. … Read more

[SOLVED] ERROR 2006 (HY000): MySQL server has gone away

This article provides the solution to the following MySQL error: ERROR 2006 (HY000): MySQL server has gone away We generally get this kind of error when we try to import or insert a large volume of data into the MySQL database. To solve this error, we can: – either update the MySQL’s configuration file: my.cnf … Read more

Node.js, MySQL & Express: Simple Add, Edit, Delete, View (CRUD)

This article shows how you can create a simple CRUD (Create, Read, Update, Delete) application in Node.js using MySQL as database. We will also be using Express Framework to build this Node.js web application. We will be using EJS as templating engine. We will be using HTTP Methods like GET, PUT, POST, DELETE to make … Read more

Ubuntu: Installing Apache, PHP, MySQL & phpMyAdmin

Here are step-by-step commands about installing apache, php, mysql, and phpmyadmin on ubuntu. 1) Open Terminal – Press: CTRL + ALT + T 2) Install Apache – In terminal, type: sudo apt-get install apache2 – To test if Apache installation, Open browser and type: http://localhost – It should show text: It Works! 3) Install PHP … Read more

Alter MySQL table to add & drop column & add Foreign Key

This article shows:- – How to add column to mysql database table after the table has already been created – How to delete column from mysql database table after the table has already been created – How to add foreign key to table column after the table has already been created Basically, all this can … Read more