Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am having problems with my database. The only way I can connect to it is via phpmyadmin. I try to use the same username and password to connect to the database in 'SQL PRO' and I get the following error message:

Lost connection to MySQL server at 'reading initial communication packet', system error: 61

My website is also having difficulty connecting to it - again using EXACTLY the same details I am using to connect in phpmyadmin. That throws this error:

SQLSTATE[HY000] [2003] Can't connect to MySQL server on '171.34.117.214' (111)

I have tried the following:

edited /etc/mysql/my.cnf and commented out

#bind-address = 127.0.0.1
#skip-external-locking

Then re-started mysql

Does anybody have any other ideas?

running sudo netstat -ntlp return the following:

    Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN      734/dovecot     
tcp        0      0 127.0.0.1:11211         0.0.0.0:*               LISTEN      818/memcached   
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN      734/dovecot     
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      734/dovecot     
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      2215/apache2    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      611/sshd        
tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      734/dovecot     
tcp6       0      0 :::995                  :::*                    LISTEN      734/dovecot     
tcp6       0      0 :::110                  :::*                    LISTEN      734/dovecot     
tcp6       0      0 :::143                  :::*                    LISTEN      734/dovecot     
tcp6       0      0 :::22                   :::*                    LISTEN      611/sshd        
tcp6       0      0 :::993                  :::*                    LISTEN      734/dovecot  
share|improve this question
    
If you run sudo netstat -ntlp to you see mysql listening on port 3306 and bound to 0.0.0.0? Have you tried running tcpdump? Do you see incoming port 3306 packets? –  Zoredache Apr 23 '13 at 16:24
    
I have added the results of sudo netstat -ntlp to my edit –  Bob Flemming Apr 23 '13 at 16:47
    
Does the server have an open unix socket? Can you connect to it? –  MKzero Apr 23 '13 at 18:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.