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

mysql php connection error

Created by retep. Last edited by retep, 3 years and 77 days ago. Viewed 2,485 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?

请以发表评论身份登录
Powered by snipsnap.org Found a mistake in a howto? Let us know via an email to p.blikibugs at rimuhosting com.