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 = 0.0.0.0
and run SQL : GRANT ALL PRIVILEGES ON database.* TO user@‘%’ IDENTIFIED BY ‘password’;
But nothing change. Please help me ! Thanks you
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!
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 )
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.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.