4

When trying to connect to mysql server via telnet I am getting following error:

telnet localhost 3306
Trying ::1...
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection timed out

I tried telnet with 127.0.0.1, hostname also, but getting same error message. But I can connect with mysql -u username -p once I am in the server.

Here is the result of netstat:

netstat -na | grep mysql
unix  2      [ ACC ]     STREAM     LISTENING     4540495  /var/run/mysqld/mysqld.sock
unix  3      [ ]         STREAM     CONNECTED     4542200  /var/run/mysqld/mysqld.sock

netstat -na | grep 3306
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN  

What could be possible problems? If you need some more details I could provide it without any problems.

Thanks a lot.

Nathan Osman
  • 32,495
Bakhtiyor
  • 12,804

2 Answers2

4

MySQL uses the UNIX socket on localhost - much faster. It won't run on a TCP port unless you tell it to do so.

0

Have you checked your iptables settings?

sudo iptables -L -v