C-NET :: PROJECTS

cat how-to-move-a-database-from-one-box-to-another.md

How to move a mysql database from one box to another

Posted
Updated
Filed under
Linux · Reference

Simple reference, moving a mysql database:

mysqldump -h <oldhostip/name> -u username -p[<password>] <databasename> > <dumpfilename>.sql
mysql -u<username> -p[<password>] < <dumpfilename>.sql
bash

Note

Note: The lack of spaces in some places of the commands. They are intended.
Note: Specifying the password after -p is []'d, which means it's optional.
Note: If you do enter a password on the command line, it will get saved in your .bash_history or similar in clear text.

Comments