My phpmyadmin works only when I'm connected to the internet.(it even works if i'm just connected to Lan) otherwise, it gives below

error:

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

Any thoughts. I've already searched this problem on google and tried all generic solutions such as editing mysql ini file, changing socket property etc. Either i'm not setting it right or something else needs to be done. I have wamp.

link|improve this question
3  
This is not a programming question. – Jonathon Reinhart Nov 17 '11 at 3:28
If this is on windows, it is better to connect over a network connection instead of using a socket. – phpdev Nov 17 '11 at 3:30
@JonathonReinhart .. who said it is? – Rahul Nov 17 '11 at 13:12
@phpdev how do i change the connection to network instead of socket? thx – Rahul Nov 17 '11 at 13:14
feedback

migrated from stackoverflow.com Nov 17 '11 at 11:41

This question came from our site for professional and enthusiast programmers.

2 Answers

Your configuration file is wrong, at least according to the PHPMyAdmin manual:

The $cfg['Servers'] array starts with $cfg'Servers'. Do not use $cfg['Servers'][0]. If you want more than one server, just copy following section (including $i incrementation) serveral times. There is no need to define full server array, just define values you need to change.

In your case, please try:

$cfg['Servers'][1]['host'] = 'localhost';
$cfg['Servers'][1]['port'] = '';
$cfg['Servers'][1]['socket'] = '';
$cfg['Servers'][1]['connect_type'] = 'tcp';
$cfg['Servers'][1]['auth_type'] = 'config';

Then modify your mysql configuration (my.cnf) to use TCP instead of name pipes or sorckets:

[client]
port=3306 # Keep this the same port as the one under mysqld below.

[mysqld]

# The TCP/IP Port the MySQL Server will listen on
port=3306 # NOTE: Do not change this if wamp has a default value for it. Instead change the port setting in the PHPMyadmin config.

Then remove any configuration for using sockets or named pipes. Reboot the server and try again to see if it worked.

link|improve this answer
actually it is using the servers[1] by doing $i = 0; $i++; in script before using $i. And i have removed the socket setting from my.ini but it still gives the same error message – Rahul Nov 18 '11 at 2:16
here are my my.ini file values # The following options will be passed to all MySQL clients [client] #password = 2222 port = 3306 # The MySQL server [wampmysqld] port = 3306 #socket = C:/wamp/tmp/mysql.sock key_buffer = 16M max_allowed_packet = 1M table_cache = 64 sort_buffer_size = 512K net_buffer_length = 8K read_buffer_size = 256K read_rnd_buffer_size = 512K myisam_sort_buffer_size = 8M basedir=c:/wamp/bin/mysql/mysql5.5.16 log-error=c:/wamp/logs/mysql.log datadir=c:/wamp/bin/mysql/mysql5.5.16/data – Rahul Nov 18 '11 at 2:23
#skip-networking #enable-named-pipe – Rahul Nov 18 '11 at 2:24
[mysqld] port=3306 – Rahul Nov 18 '11 at 2:24
feedback

Did you try these ? http://forums.mysql.com/read.php?35,64808,254785#msg-254785

link|improve this answer
i've tried this... here are my settings <br/><br/> $cfg['Servers'][$i]['verbose'] = 'localhost'; $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['port'] = ''; $cfg['Servers'][$i]['socket'] = ''; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['extension'] = 'mysqli'; $cfg['Servers'][$i]['auth_type'] = 'config'; <br/><br/> i tried all suggestions but they didn't work. it stopped working even after i got connected to internet. but when i changed the 127.0.0.1 to localhost, it worked online but not when not connected to internet (original problem) – Rahul Nov 17 '11 at 13:47
question.. i'm on a windows machine, how socket path (/tmp/mysql.sock) will be treated on my machine? also... i have a mysql.sock file in c:\wamp\tmp\mysql.sock path but the file is blank. any suggestions? – Rahul Nov 17 '11 at 13:56
and one more thing to notice... my connection type is tcp. can the issue be related with that? thanks everyone for their help – Rahul Nov 17 '11 at 13:58
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.