Skip to main content

cPanel Cron job commands can't connect to Database ?!

Comments

4 comments

  • Scriptking
    im having same issue, every day i wake up to sql server turned off... i need to login to WHM and re-start it.. its a real pain.. this is the error i wake up to every day.. /etc/cron.hourly/modsecparse.pl: DBI connect('modsec:localhost','modsec',...) failed: Lost connection to MySQL server at 'handshake: reading inital communication packet', system error: 104 at /etc/cron.hourly/modsecparse.pl line 20 Unable to connect to mysql database at /etc/cron.hourly/modsecparse.pl line 20.
    0
  • cPanelMichael
    Hello :) Check to see if the /tmp/mysql.sock symbolic link exists:
    ll /tmp/mysql.sock
    If not, create it via:
    ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
    Thank you.
    0
  • jasonsmit
    Hello Michael, Thanks for Your reply Both files are exist on the server, but they are empty, Please Else solutions? Thank You.
    0
  • cPanelMichael
    It's likely a limitation of the jailed shell/noshell access applied to the account. Do you experience the same issue when the account is assigned normal shell access? Thank you.
    -1

Please sign in to leave a comment.