Tranferring data from one MySQL server to another
suggest changeIf you need to copy a database from one server to another, you have two options:
Option 1:
- Store the dump file in the source server
- Copy the dump file to your destination server
- 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.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents