[ start | index | login ]
start > knowledgebase > linux > webserver > mysql php connection error

mysql php connection error

Created by retep. Last edited by retep, 2 years and 357 days ago. Viewed 2,301 times. #1
[edit] [rdf]
labels
attachments
Getting this error? Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Check if there is a mysql.sock file at /var/lib/mysql/mysql.sock (rather than in /tmp).

If so, change /etc/php.ini from: mysql.default_socket =

To: mysql.default_socket = /var/lib/mysql/mysql.sock

And restart httpd.

TODO: This problem has cropped up on a 'previously working setup' (not one of mine). So I'm not sure why there is a change from /tmp to /var/lib/mysql. New version of mysql? New version of php?

no comments | post comment
Powered by snipsnap.org Found a mistake in a howto? Let us know via an email to p.blikibugs at rimuhosting com.