cPanel Cron job commands can't connect to Database ?!
Hello,
I have receiving this following error messages from cpanel running hourly and daily Cronjobs :
---------------------
error massege:
PHP Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock
or
Critical Error : Could not connect to the database
or
ERROR OUTPUT:
mysqldump: Got error: 1045: Access denied for user '***_user'@'localhost' (using password: YES) when trying to connect
or ......
---------------------
Note: my script can connect to database and mysql fine and no problem there ! and when running these command on root crons haven't problem and running fine there ,
But php script command can not connect to database correctly under cpanel end user (normal account user) CronJobs, and send me that error messages,
Please help me to fix ,
Thanks to all
-
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 -
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 -
Hello Michael, Thanks for Your reply Both files are exist on the server, but they are empty, Please Else solutions? Thank You. 0 -
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.
Comments
4 comments