0

I have installed mysql lampp on my server. When i try to connect remotely using this command:

mysql -h SERVER_IP -u USER -p

it returns me error :

ERROR 2003 (HY000): Can't connect to MySQL server on 'SERVER_IP' (110)

I have setting bind-address to 0.0.0.0 in /opt/lampp/etc/my.cnf file, I have also give this iptables rule to allow access to mysql port on 3306

iptables -A INPUT -i eth0 -p tcp -m tcp --dport 3306 -j ACCEPT

Nmap on local server give the following output:

PORT STATE SERVICE

#nmap -p 3306 localhost
PORT     STATE SERVICE
3306/tcp open  mysql

but when nmap from outside the server network i.e using external ip, nmap give the following output:

#nmap -p 3306 SERVER_IP
PORT     STATE  SERVICE
3306/tcp filtered mysql

output from netstat -ntulp |grep 3306

tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      17946/mysqld

the port is listen according to netstat but can't accept connection from outside the network (remotely)

What is wrong here?

Lundu Harianja
  • 443
  • 1
  • 9
  • 17
  • 1
    I don't know whether you have saw it: http://stackoverflow.com/questions/5713808/trying-to-connect-to-remote-mysql-host-error-2003 – Risk4U Oct 09 '15 at 05:55

1 Answers1

0

try one thing that go to your mysql server and execute below command-

service iptables stop

Now check your connection.

Zafar Malik
  • 6,734
  • 2
  • 19
  • 30