Re: #2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)
Posted by: Justin Lindberg
Date: July 13, 2008 01:10AM

This is interesting. I also just recently ran into the same problem, and the same solution seemed to work for me on OpenBSD 4.3. It looks like whatever hostname you assign to $cfg['Servers'][$i]['host']
in config.inc.php is eventually passed as the first parameter to the mysqli_real_connect() function in phpMyAdmin/libraries/dbi/mysqli.dbi.lib.php. According to the documentation for this function at http://us.php.net/manual/en/mysqli.real-connect.php it says that the first parameter

'Can be either a host name or an IP address. Passing the NULL value or the string "localhost" to this parameter, the local host is assumed. When possible, pipes will be used instead of the TCP/IP protocol.'

It looks like on OpenBSD there is a socket listening at "/var/run/mysql/mysql.sock". On Kubuntu it listens at "/var/run/mysqld/mysqld.sock". Could it be that PHP doesn't always know where to find the socket if it's connecting to localhost? (And in the case of OpenBSD, that socket would be outside the web server's chroot jail, anyways.)

Specifying 127.0.0.1 rather that localhost would force the connection to be carried out over tcp, which would bypass any concerns about finding a unix socket. I could be wrong, but it may ultimately be a PHP problem, since apparently PHP's mysqli_real_connect() function isn't looking in all the right places for the local socket, and it isn't falling back to a tcp connection if a unix domain socket isn't found.

Options: ReplyQuote


Subject
Written By
Posted
Re: #2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)
July 13, 2008 01:10AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.