Linux MySQL Commands
- Log into mysql
mysql -u root -p
- Import database as root user
mysql -u root -p mydatabase < backup.sql
- Import database as non root user
mysql -u myuser -p mydatabase < backup.sql
- Check tables
USE mydatabase;<br>SHOW TABLES;
- Delete all tables one by one
SET FOREIGN_KEY_CHECKS = 0;<br>DROP TABLE IF EXISTS <code>table1,table2,table3, ...;
SET FOREIGN_KEY_CHECKS = 1;</code>
Take Backup of Database
mysqldump -u root -p mydatabase > mydatabase_backup.sql
Comments
Post a Comment