Migrate a MySQL Database To A New Server

Take a mysql dump of the existing database:

mysqldump --lock-all-tables -u root -p --all-databases > dump.sql

Copy the dump.sql file to your new mysql server

mysql -u root -p < /tmp/dump.sql

This should export all your data.

For more detailed info:

https://www.digitalocean.com/community/tutorials/how-to-migrate-a-mysql-database-to-a-new-server-on-ubuntu-14-04

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s