Report this

What is the reason for this report?

I can't connect to MySQL server remotely.

Posted on November 15, 2019

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.



This textbox defaults to using Markdown to format your 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.

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.

This comment has been deleted

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.