Question

Struggling to open remote mysql connection

I’ve set bind address to 0.0.0.0 and now have mysqld 270434 mysql 24u IPv4 1223739 0t0 TCP *:3306 (LISTEN)

If I nc -vc [ip] 3306 I always get operation timed out.

I’ve tried commenting out bind address, changing it to *, tried all the same with mysqlx-bind-address too but can’t connect to the server at all.

No firewall enabled

Any ideas?


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello,

Setting the bind-address to 0.0.0.0 is indeed correct.

As you don’t have a firewall enabled on the MySQL Droplet, do you by any chance have a firewall on the server/PC that you are connecting from? If this is the case you might have to open port 3306 for outgoing TCP connections.

Alternatively, what I prefer doing is to connect to my remote MySQL servers over SSH with Table Plus as described here:

https://tableplus.com/blog/2019/08/ssh-tunnel-secure-database-connection.html

That way you don’t have to expose the MySQL service to the world.

Let me know how it goes! Regards, Bobby