How to change
/var/lib/mysql to another directory?
Create a backup of
Copy all files from
/var/lib/mysqlto desired directory:
# cp -r /var/lib/mysql /data/mysql
/etc/my.cnfby changing the location to where you have copied
# vi /etc/my.cnf datadir=/data/mysql
# service mysqld restart
Note: Be sure that the path to socket
mysql.sock is unchanged in
my.cnf and it is /var/lib/mysql.
Also the directory /var/lib/mysql itself should present on the server as changing the path to the socket can cause Plesk crush.