I\'ve been trying to set mysql and phpMyAdmin for the last 12 hours, without any success. And yes, after hours and hours of Google-ing I know that is a common problem and I\
The problem I had with this was because PHP was trying to connect via a UNIX socket instead of TCP. This is similar to this error: Error when connecting to MySQL using PHP/PDO
First, make sure you have a my.cnf config for mysql then add your default socket location:
[mysqld_safe] socket = /tmp/mysql.sock
Next in your php.ini, let PHP know where it is:
mysql.default_socket = /tmp/mysql.sock