How do config VPS to allow Remote Connect from Desktop Application to MySQL of my VPS ?

Hi, DO Support Team

I can’t connect to MySQL Server of My DigitalOcean VPS from my JAVA Application ( i use MySQL Workbench to check connection but this still receive error - Can’t connect to MySQL server (10060) ).

I have edit my.cnf file (

port = 3306 bind-address =

and run SQL : GRANT ALL PRIVILEGES ON database.* TO user@‘%’ IDENTIFIED BY ‘password’;

But nothing change. Please help me ! Thanks you

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.

It is very bad to open MySQL (or any database for that matter) to the internet. You should turn back on the firewall to block all ports (minus whatever you need). Leave MySQL (3306) blocked to anything that is not your servers. If you need remote access, you should use tools like SSH port forwarding. It is a lot more secure (assuming you only use key auth) and encrypts your traffic to the server. Plus you don’t need to give everyone access to 3306 (very bad!). An example:

ssh -L <Any local port higher than 1000>:localhost:3306 myserver.domain.tld

Reason you should pick a local port higher than 1000 is you won’t need root to use it.

Hi, i solved my issues. I using Centmimod and i have opened port for MySQL Connection from CSF Firewall config file ( /etc/csf/csf.conf )