PDA

View Full Version : How to backup and restore mysql dump file on linux command line



Fli
07-01-2013, 07:30 PM
How you can backup mysql and restore mysql dump .sql file on linux OS via command line?
You need to know your mysql password.

Backup table named "tablename" from database "databasename" for user "root" and mysql password "Mysqlrootpassword"


mysqldump -u root -pMysqlrootpassword databasename tablename > tablename.sql

If you wish to backup whole database, just dont add any "tablename"

Restore mysql dump file back into mysql database



mysql -u root -p databasename < tablename.sql