MySQL Socket Error in phpMyAdmin

While accessing phpMyAdmin, you may get the following error.

#2002 – The server is not responding (or the local MySQL server’s socket is not correctly configured)

This is due to the missing socket file in the location /tmp.

The socket path which is specified in the phpMyAdmin configuration file is /tmp/mysql.sock.

$ vi /usr/local/cpanel/base/3rdparty/phpMyAdmin/
cfg[‘Server’][‘socket’]         = ‘/tmp/mysql.sock’;

If mysql.sock is missing in /tmp, then create a link to the mysql.sock file in /var/lib/mysql.

$ ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

There is also another fix for this issue.

1. Open the phpMyadmin config file “”.vi /usr/local/cpanel/base/3rdparty/phpMyAdmin/

2.Locate the line:

$cfg[‘Servers’][$i][‘host’]          = ‘localhost’;

3.Replace ‘localhost’ with ‘’ and save.

$cfg[‘Servers’][$i][‘host’]          = ‘’;

This will also fix the issue.


Both comments and pings are currently closed.

Comments are closed.