I am using CentOS with cPanel. On my server, all MySQL databases save at
/var is 100% full and MySQL has stopped working. How can I move the databases to a new directory like
/home/mysql especially considering that this server is managed with cPanel?
I can't confirm this from cpanel, as I don't have access, but this is an example from the console connected by ssh and sudo to root. There are arguments for using a bind entry in /etc/fstab instead of a symlink, but this works for me.
My normal procedure is to stop mysql, move the directory contents, link the original, and restart mysqld.
I just noticed a similar question, of which this is close to a duplicate of, which mentions some issues of doing that above with selinux enabled; http://crashmag.net/change-the-default-mysql-data-directory-with-selinux-enabled
So if you have selinux there are some additional steps.
if you want to change
Your new data directory MUST be owned by
restart mysql server