I can't connect to MySQL server remotely.

  • Posted November 15, 2019
  • MySQL

I’ve set the bind address to my droplet’s ip address. I’ve granted my user permission to all tables from any ip address and flushed. I’ve restarted the server. I still can’t connect to the MySQL server remotely.

An update: I can’t even ping it.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I can’t even connect to mysql now from my server. ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

Is there anyway I can just get one file off this droplet? If I have one file off, I can delete this entire droplet.

Hi @alecsgavyn,

If you can’t ping your server, most probably you’ve been blocked or connections are just not allowed.

Please try and allow yourself via IPTables. To do so, SSH via the console in your control panel and type in

/sbin/iptables -A INPUT -p tcp -s XXX.XXX.XXX.XXX -j ACCEPT
/sbin/iptables -A OUTPUT -p tcp -d  XXX.XXX.XXX.XXX -j ACCEPT

The above command will allow ALL traffic from your IP. Please remember to change XXX.XXX.XXX.XXX to your IP address.

The above should help you connect to your MySQL remotely.

Regards, KDSys

This comment has been deleted