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?