PhpMyAdmin can’t connect to local MySQL server through socket ‘/var/lib/theseql/thesql.sock’

phpmyadmin

I'm trying to get phpMyAdmin working, connecting locally to mysql from Centos 6.3 running in VMWare Player.

mysqladmin -u root -p status
indicates that mysql is running.

Both my.cnf and config.inc.php point to socket `/var/lib/mysql/mysql.sock“.

I've tried 127.0.0.1/phpMyAdmin and localhost.0.0.1/phpMyAdmin.

In both cases I get the message:

#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)

Can anyone tell me what else to check?

Best Answer

You need to set the appropriate SELinux boolean to allow the web server to communicate with MySQL.

setsebool -P httpd_can_network_connect_db 1