phpMyAdmin无法通过套接字“/var/lib/myseql/mysql.sock”连接到本地MySQL服务器

我试图让phpMyAdmin工作,从本地连接到运行在VMWare Player中的Centos 6.3的MySQL。

mysqladmin -u root -p状态表示mysql正在运行。

my.cnf和config.inc.php都指向`/ var / lib / mysql / mysql.sock`套接字。

我试过127.0.0.1/phpMyAdmin和localhost.0.0.1 / phpMyAdmin。

在这两种情况下,我得到的消息:

#2002 - Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) The server is not responding (or the local server's socket is not correctly configured) 

谁能告诉我还有什么要检查?

您需要设置适当的SELinux布尔值以允许Web服务器与MySQL进行通信。

 setsebool -P httpd_can_network_connect_db 1