The system adds a hard drive. To create a new partition/data folder, MySQL for Data folder/var/lib/mysql
1. Stop MySQL Repair
[[Email protected]~]# service MySQL Stop
Shuttingdown MySQL ... success!
[[Email protected]~]#
2. Move the MySQL original data file to the MySQL folder of the new hard disk partition
[Email protected] ~]# mv/var/lib/mysql//data/mysql/
3, the/data/mysql/mysql link to the/var/lib
[Email protected] ~]# ln-s/data/mysql/mysql/var/lib/
4, change the permissions of the data file folder
[Email protected] ~]# chown-r mysql:mysql/data/mysql/
5. Turn off SELinux
6, [[email protected] ~]# sed-i ' s/selinux=enforcing/selinux=disabled/'/etc/selinux/config
7. Restart Server
[[Email protected] ~] #reboot
Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.
How to migrate MySQL data files to a new hard disk partition