I just got finished installing mysql on my droplet. I have set up and opened ports 80,443,(ssh) without a hiccup. My only problem now is that even though my droplet says that 3306 is open, I can’t connect to it outside of ssh. It says that 3306/tcp is set to allow ANYWHERE but I still can’t connect to it, even after a complete restart.
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!
This comment has been deleted
What IP address is MySQL listening on?
sudo netstat -plutn | grep 3306
If 127.0.0.1, then you will have to configure it to listen on all interfaces instead (127.0.0.1 and your droplet’s IP address). Edit /etc/mysql/my.cnf and set bind-address to 0.0.0.0:
bind-address = 0.0.0.0
Then, restart MySQL:
sudo service mysql restart
If you’re the only one who’s going to access MySQL externally, it’s recommended to keep it listening on 127.0.0.1 and using an SSH tunnel instead as it’s much more secure:
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.