How To Migrate MySQL To A New Volume On CentOS
erics, Posted October 26th, 2011 at 11:33:54am
Stop MySQL and move the existing database files to the EBS volume.
1 2 3 |
service mysqld stop mkdir /data/mysql mv /var/lib/mysql/ /data/mysql/lib/ |
Use the bind
option to the mount
command in the /etc/fstab
file to direct MySQL to the correct files, then restart:
1 2 3 4 |
mkdir /var/lib/mysql echo "/data/mysql/lib /var/lib/mysql none bind" | tee -a /etc/fstab mount /var/lib/mysql service mysqld start |
Leave Your Comment
All fields marked with "*" are required.