Moved MySQL db to home directory and now cron jobs can't connect to the database


Mar 20, 2013
cPanel Access Level
Root Administrator
I recently moved my MySQL databases from root to home and symlinked the old folder to the new one, rebooting the server in the process. The website is working fine and scripts are connecting to MySQL as before without any changes. The only problem I have now is that cron jobs on attempting to connect to the MySQL database return:

"Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)"

The commands run perfectly fine if I run them in the shell as root, it's just they all return that error when the cron job tries to run them. Any suggestions of where to look for the problem?