Home > Database > Mysql Tutorial > body text

Can't connect to local MySQL server through sock_MySQL

WBOY
Release: 2016-06-01 13:08:42
Original
876 people have browsed it

Error信息

ERROR - 2014-06-07 11:53:33 --> 2002 - SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /var/www/html/blog/fuel/core/classes/database/pdo/connection.php on line 100

本人服务器的现象是:

mysql可以正常启动,命令执行也没有任何问题

但是还是会出现上面的错误

原因:

经过调查,是因为/var/lib/mysql/mysql.sock 这个文件的权限有问题
解决办法:
chmod 777 /var/lib/mysql/mysql.sock
Copy after login




source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template