phpmyadmin

#2002 - The server is not responding

PhpMyAdmin Error:

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

There are various reasons for this error. Several things to check are:

  1. Edit config.inc.php file, and specify '127.0.0.1' (instead of any other value like 'localhost) for the $cfg['Servers'][$i]['host'] setting as follows:

    $cfg['Servers'][$i]['host'] = '127.0.0.1';

  2. Check my.cnf file for the following entries:

    [mysqld]
    socket=/tmp/mysql.sock
    old-passwords

    [client]
    socket=/tmp/mysql.sock

    Only add the 'old-passwords' mentioned above if you are using an older version of PHP (PHP4).

  3. Make sure that you do not have any older versions of MySQL installed that are conflicting.
  4. Edit config.inc.php file, and specify the MySQL socket location (as seen in the above [mysqld] socket setting):

    For example, if your MySQL socket is /tmp/mysql.sock, find the line in config.inc.php that has the $cfg['Servers'][$i]['socket'] setting and change it to:

    $cfg['Servers'][$i]['socket'] = '/tmp/mysql.sock';

  5. Set the connection mode to socket by changing $cfg['Servers'][$i]['connect_type'] to:
    $cfg['Servers'][$i]['connect_type'] = 'socket';

    If there is no such setting, simply add in the above line and re-try.

  6. Add this entry to php.ini file (again changing the '/tmp/mysql.sock' to your actual socket location) and restart Apache:

    mysql.default_socket = "/tmp/mysql.sock"

  7. Edit the config.inc.php using the phpmyadmin /setup configuration page:

    In the setup screen, select the end-of-line character to be '\r' if you have a Macintosh, or '\n' for a Linux machine.

  8. Disable SELinux if you are using it, and re-try. If it works, SELinux is the issue.
  9. Run the following at your mysql prompt (using the standard mysql client):
    mysql> SELECT USER,HOST FROM mysql.user;

    Next, identify the user your are using for phpMyAdmin, and then run:

    mysql> SHOW GRANTS FOR 'user'@'host';

    Ensure that this userid has appropriate access rights.

Syndicate content
Comment