- On the new server, install mysql server:
sudo apt-get install mysql-server mysql-client
- On the new server, stop the mysql server:
sudo service mysql stop
- On the new server, backup /var/lib/mysql:
sudo mv /var/lib/mysql /var/lib/mysql.bak
- On the old server, stop the mysql server:
sudo /etc/init.d/mysql stop
- On the new server, mirror /var/lib/mysql directory from the old server:
sudo rsync -avz root@old_server:/var/lib/mysql /var/lib/
- On the new server, run
(NOTE: if you forget the root user password, you can reset the root password.)sudo mysql_upgrade -u root -p
- Start mysql server on the new server:
sudo service mysql start
Search This Blog
Ubuntu: Migrate all mysql databases from one server to another
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment