首页 >数据库 >mysql教程 >无法通过套接字连接到本地MySQL服务器&

无法通过套接字连接到本地MySQL服务器&

WBOY
WBOY原创
2016-06-07 15:15:421051浏览

执行PHP 时出现类似这样的错误讯息: Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) in /home/httpd/html/show. php on line 9 请将/tmp/mysql.sock link 到/var/lib/mysql 目录里即可

执行PHP 时出现类似这样的错误讯息:

Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) in /home/httpd/html/show.php on line 9

请将/tmp/mysql.sock link 到/var/lib/mysql 目录里即可:

linux# ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn