mysql logo

Using mysqldump from the command line

Spread the love

To use mysql to take a dump of a database as a backup or to migrate the database to another server use the following comand:

mysqldump -u [USERNAME] -p[PASSWORD] [DATABASE-NAME] > dumpfilename.sql

To restore the dump use the following comand:

mysql -u username -p database_name < file.sql

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top