Mysql – phptheadmin error #2002 cannot connect to thesql server

MySQLPHPsocket

I am getting the error in the title when trying to connect to my MySQL server. I have reinstalled MySQL and PHP several times and tried a slew of command line work based on information I searched out.

web.mysql is running and I know that my mysql.sock exists and is located in ~/private/tmp/ and also in ~/tmp/. I also have plenty of hard drive space. I have installed and setup phpMyAdmin correctly only adding a password to 'Password for config auth'. I have also connected to the server via Sequel Pro.

Why can't I connect to the server via phpMyAdmin? I'm on a 64-bit Intel Mac running Snow Leopard

Best Answer

Make sure phpMyAdmin is not trying to look for mysql.sock in /var/lib/mysql/. I had the same error yesterday and creating a link from /var/lib/mysql/mysql.sock to /tmp/mysql.sock fixed it.