Friday, September 21, 2007

Issue: We are receiving the error while accessing the mysql on server

Issue: We are receiving the error while accessing the mysql on server

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

Resolutions:

Following are the possible fixes for the above errors

1) try to change hostname 'localhost' with '127.0.0.1'

2) In case that doesn't work, I would suggest explicitly specifying the mysql socket location in the config.inc.php.

For example, the mysql socket could very well be /tmp/mysql.sock, so you would just find the line in config.inc.php that says:

$cfg['Servers'][$i]['socket'] = '';

and change it to say:

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

3) When you make users generally make two entries, and grant access to both.

One is username@'%' and the other is username@'localhost' - a hint I took from the manual when first installing mysql. If your app is not on a UNIX/Linux box, make sure localhost resolves (try ping localhost, or run script in command-line mode (you can learn how to run PHP e.g., from the cmd.exe window).

Further, it has been noticed a change in the encryption of the passwords for USERS that have caused problems with php programs that worked fine with mysql 4.X but not in 5.X. (For these you can create users with no password and only GRANTING usage (e.g. SELECT) rather than 'ALL'.