Tranferring data from one MySQL server to another

suggest change

If you need to copy a database from one server to another, you have two options:

Option 1:

  1. Store the dump file in the source server
  2. Copy the dump file to your destination server
  3. Load the dump file into your destination server

On the source server:

mysqldump [options] > dump.sql

On the destination server, copy the dump file and execute:

mysql [options] < dump.sql

Option 2:

If the destination server can connect to the host server, you can use a pipeline to copy the database from one server to the other:

On the destination server

mysqldump [options to connect to the source server] | mysql [options]

Similarly, the script could be run on the source server, pushing to the destination. In either case, it is likely to be significantly faster than Option 1.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents