I can't connect to MySQL server remotely.

November 15, 2019 504 views
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.

3 Answers

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

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.

Have another answer? Share your knowledge.