Knowledgebase

phpMyAdmin error #2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)

If this is your phpMyAdmin error:
#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)

We have recently started seeing an issue where phpmyadmin has problems connecting to mysql. Given the number of accounts that have been effected in a short time we suspect that the problem is related to an update released by Cpanel. It seems that the problem is related to where phpmyadmin expects to find mysql's socket file. This problem seems to be resolvable by adding a symbolic link between /tmp/mysql.sock and /var/lib/mysql/mysql.sock . You can create this link by running the command

Code:
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock


Alternativly there is a fix recommended on the cPanel support forums. (http://forums.cpanel.net/showpost.ph...6&postcount=11)

From an ssh prompt into your VPS (lines beginning with # contain literal command-line commands after the #):

  1. # vi /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php
  2. Find the line $cfg['Servers'][$i]['socket'] = '';
  3. Change the ['socket'] = '' entry to '/var/lib/mysql/mysql.sock';
  4. On the next line, change ['connect_type'] = 'tcp' to ['connect_type'] = 'socket'
  5. Save and exit vi (<ESC> followed by :wq)
  6. # service mysql restart (if this returns 'unrecognized service', try it as 'mysqld' instead)
  7. # service cpanel restart
  8. # service httpd restart

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How do I configure Dreamweaver MX for PHP and MySQL?

Remote Info:Access: FTPFTP Host: domainname.comHost Directory: public_html(this is the folder...

How can I connect to MySQL Using PHP

PHP has built in support for a number of databases including MySQL, which is by far the most...