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

MongoDB: Basic Select, Insert, Update, Delete – CRUD [Beginner Tutorial]

MongoDB is an open-source document database. Document in MongoDB means a row or record in the database. A document contains data in key-value pairs. MongoDB is popular for it’s high performance, scalability and availability. This article shows how to perform simple select, insert, update, delete database operations in MongoDB. That’s also referred as CRUD (Create, … 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

MySQL: Backup/Export and Restore/Import Database & Table

This article shows how to backup/export and restore/import single & multiple databases and tables in MySQL. Backup/Export 1) Backup/Export single database mysqldump -h hostname -u username -p database_name > /path/backup.sql 2) Backup/Export multiple databases mysqldump -h hostname -u username -p –databases db1 db2 db3 > /path/threedb.sql Here: db1, db2, db3 are three different database name. … Read more