Can someone tell me why the following error comes up when trying to run mysqldump in shell?
-su-2.05b$ php ./db_backup.php
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61) when trying to connect
Can someone tell me why the following error comes up when trying to run mysqldump in shell?
-su-2.05b$ php ./db_backup.php
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61) when trying to connect
Does /tmp/mysql.sock exist?
Yes, it does exist.
What are the permissions on it?
srwxrwxrwx 1 mysql wheel 0B Dec 31 01:58 mysql.sock
What user are you running the script as?
I'm running it as a cPanel user account which has "normal" shell access enabled in WHM.
Are you sure that mysql.sock exits in the /var/lib/mysql/ and in /tmp/
I have seen many problems like that and solving this issue varies from one server to another.
Andy Reed
RHCE and CCNA
ServerTune.com