[ 开始 | 索引 | 登录 ]
start > knowledgebase > linux > webserver > mysql php connection error

mysql php connection error

Created by retep. Last edited by retep, 7 years and 262 days ago. 被访问了 4,741 次。 #1
[编辑] [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.