January 20, 2012

Backup to a .sql file and Restore from .sql database file (MySQL)


Backup

From above link :-
In your command, you can't have a space between -p and the password. Also, mysqldump has to be run on the command line, not in a mysql shell.

Try this on your command line

mysqldump -u username -ppassword databasename > backup.sql

Restore
  • Go to the folder with the backup.sql file from console
  • Start MySQL server
  • Type in source backup.sql
Reference

No comments:

Post a Comment