Page 1 of 1

Need help ASAP - MySQL Connect Error

Posted: Tue Jul 12, 2005 2:49 pm
by tknd2680
THIS IS THE ERROR I'M GETTING, CAN ANYONE TELL ME WHAT THE PROBLEM IS

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2) in /mnt/htdocs/.phpfuncs on line 2

Warning: mysql_select_db(): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2) in /mnt/htdocs/.phpfuncs on line 3

Warning: mysql_select_db(): A link to the server could not be established in /mnt/htdocs/.phpfuncs on line 3

Posted: Tue Jul 12, 2005 3:07 pm
by Chris Corbyn
Restart your MySQL server ;)

If that's not where mysql.sock is actually stored then include the path to mysql.sock in the mysql_connect() function as per the manual.

Posted: Tue Jul 12, 2005 4:37 pm
by pickle
Ya, restart your server. I had this problem yesterday and that fixed it. If that doesn't fix it, however, try goofing with your my.cnf file.