Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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

Discussion in 'Database Discussion' started by johnmark33, May 12, 2014.

  1. johnmark33

    johnmark33 Registered

    Mar 20, 2013
    Likes Received:
    Trophy Points:
    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?
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice