MySQL remote access not working - Port Close?

Posted by dave.zap on Server Fault See other posts from Server Fault or by dave.zap
Published on 2012-12-06T03:28:51Z Indexed on 2012/12/06 5:07 UTC
Read the original article Hit count: 591

Filed under:
|
|
|
|

I am not able to get a remote connection established to MySQL. From my pc I am able to telnet to 3306 on the existing server, but when I try the same with the new server it hangs for few minutes then returns

# mysql -utest3 -h [server ip] -p
Enter password:
ERROR 2003 (HY000): Can't connect to MySQL server on '[server ip]' (110)

Here is some output from the server.

# nmap -sT -O localhost -p 3306
...
PORT     STATE  SERVICE
3306/tcp closed mysql
...


# netstat -anp | grep mysql
tcp        0      0 [server ip]:3306        0.0.0.0:*                   LISTEN      6349/mysqld
unix  2      [ ACC ]     STREAM     LISTENING     12286  6349/mysqld         /DATA/mysql/mysql.sock

# netstat -anp | grep 3306
tcp        0      0 [server ip]:3306    0.0.0.0:*        LISTEN      6349/mysqld
unix  3      [ ]         STREAM     CONNECTED     3306   1411/audispd

# lsof -i TCP:3306
COMMAND  PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
mysqld  6349 mysql   10u  IPv4  12285      0t0  TCP [domain]:mysql (LISTEN)

I am running...

OS CentOS release 5.8 (Final) mysql 5.5.28 (Remi)

Note: Internal connections to mysql work fine.

I have disabled IPtables, the box has no other firewall, it runs Apache on port 80 and ssh no problem.

Had followed this tutorial - http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html

I have bound the IP address in my.cnf

user=mysql
bind-address = [sever ip]
port=3306

I even started over by deleting the mysql folder in my datastore and running

mysql_install_db --datadir=/DATA/mysql --force

Then recreated all the users as per the manual...

http://dev.mysql.com/doc/refman/5.5/en/adding-users.html

I have created one test user

CREATE USER 'test'@'%' IDENTIFIED BY '[password]';
GRANT ALL PRIVILEGES ON *.* TO 'test'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;

So all I can see is that the port is not really open. Where else might I look?

thanks

© Server Fault or respective owner

Related posts about mysql

Related posts about centos