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

    Joined:
    Mar 20, 2013
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,617
    Likes Received:
    1,787
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

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