I have the default mysql configuration, thats why my data folder is over the /var/ partition,and since this partition is keeping without free space, I wanted to move my data folder.
I used the following steps to move MySQL default directory in cPanel.
First stop MySQL service on the server.
root@justgeek~]# /etc/init.d/mysql stop
Create New MYSQL directory where you want to move your data.
root@justgeek~]# mkdir /home/mysql
Now, move MySQL directory
root@justgeek~]# mv /var/lib/mysql /home/mysql
Edit the my.cnf file
root@justgeek~]# vi /etc/my.cnf
Now in the mysqld section add the following
Now start MySQL service.
root@justgeek~]# /etc/init.d/mysqld start
Once this is done verify your websites and make sure that everything is working properly. Just in case if you face any issues you can contact us VIA contact page.