ERROR 2003 (HY000): Can't connect to MySQL server on 'XXX.XX.XX.XX' (110)

October 28, 2017 264 views
MySQL Apache Firewall Ubuntu

I had setup another instance only for MySQL server.

This is overall what I did to setup my remote access for MySQL:

Configure

vi /etc/my.cnf
[mysqld]
bind-address=SQL-SERVER-IP
# skip-networking
 /etc/init.d/mysql restart

Allow firewall ports

sudo ufw allow 3306/tcp
sudo ufw allow 3306
sudo ufw allow 8080/tcp
sudo ufw allow 8080
sudo service ufw restart

Grant access to remote IP address

mysql -u root -p mysql
GRANT ALL ON foo.* TO root@'SECOND-INSTANCE-SERVER-IP' IDENTIFIED BY 'PASSWORD';
Query OK, 0 rows affected, 1 warning (0.00 sec)
exit

Test it

mysql -u root -h 'SECOND-INSTANCE-SERVER-IP' -p

Error produced:

ERROR 2003 (HY000): Can't connect to MySQL server on 'SECOND-INSTANCE-SERVER-IP' (110)

1 Answer

Can you do telnet localhost 3306 ?

Have another answer? Share your knowledge.