#2002 – The server is not responding (or local MySQL server’s socket is not correctly configured)
If you are at the end of your tether, go straight to the quick fix otherwise carry on reading.
The first think to check is obviously that the mysql daemon is definately running, the quickest way to do this is to simply use the mysqladmin ping command:
and you should see:
mysqld is alive
If you don't see the above (mysqld is alive) then you need to start the mysql daemon:
With confirmation that mysqld is running you now need to make sure that you have entered the correct host, port and socket in the config file or set-up script.
The host is usually localhost however this may be different depending how you have your server setup, if you are connecting to a remote server then the host is the name of the server you are connecting to. You can check the hostname by looking at the command line prompt whilst logged into the server where mysql is hosted :
In the examples above, your hostname would be either localhost or someserver.com.
The port is usually 3306 and the socket is usually /var/mysql/mysql.sock.
You can check both the port and socket using the following command:
This will list of of your mysql variables in alphabetical order, just scroll down to port to find out the port number and socket to confirm the socket.
Finally check you have the connection type tcp or socket. The default is tcp however some servers allow socket only connections for tightened security.
Check in the variables obtained above for skip_networking, if this is set to ON then you must set the connection type to socket otherwise leave it as tcp.
If you have checked all of the above and you are still getting the error then proceed to the quickfix below where you will find details about a common cause of this problem.
Providing mysqld is running and phpmyadmin is correctly configured (see checklist above) the issue is most likely to be the following:
A symbolic link to the socket must be created in your server's temporary directory.
The temporary directory is usually /tmp however you can double check this within your mysql variables by issuing the following command:
Scroll down to tmpdir to find the temporary directory that mysql uses, you may also wish to re-confirm the socket path too which is listed under socket within the variable list - the default is /var/mysql/mysql.sock.
To create the symbolic link, issue the following command:
#ln -s /var/mysql/mysql.sock /tmp
Note : Don't forget to replace /var/mysql/mysql.sock with your socket path and /tmp with your temporary directory, the above example uses the default settings.
Note : Debian and Ubuntu users should type mysql instead of mysqld.
You should now be able to log into phpMyAdmin.