I’m able to ping the remote server I am attempting to connect to successfully. However, when running the MySQL command:
mysql -u monty -h website.com -p
I receive the following error:
ERROR 2003 (HY000): Can't connect to MySQL server on 'website.com' (111)
I’ve followed the instructions found here that show how to create a user with necessary privileges:
mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'
-> WITH GRANT OPTION;
mysql> CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%'
-> WITH GRANT OPTION;
I’ve also commented out the following line in /etc/mysql/my.cnf
# bind-address = 127.0.0.1
Even so, I’m still unable to connect remotely. Is there something I’m missing here? Thanks again all.
Error
111isConnection refused:There’s a few common ways this happens:
REJECTthese packets. TCP packets are handled differently than ICMP packets, so being able topingdoes not necessarily imply the ability to route any random TCP stream. Ask admins on the systems to checkufworiptablesfor firewalling data./var/log/audit/audit.loganddmesg(1)output forreject,denied,AVC, etc.bind-addressconfiguration. Try adding an explicitbind-address=0.0.0.0(Google cache link; I cannot contactdev.mysql.comfor some reason) to the configuration file to force binding to all addresses. Checknetstat -anp | grep -i mysqlto see which ports, if any, it is listening to.