I have problems with my database connectivity. I can connect using localhost, but when I try to connect using my droplet’s IP I just can’t.
I’ve granted all privilages to the user and flushed them all. Still nothing.
Then I run command “netstat -plant|grep “:3306”|grep “LISTEN”” and noticed that it listens on 127.0.0.1. I tried to edit my /etc/mysql/my.cnf file, but it was empty (by empty I mean lot of commented text and two lines which are !includedir /etc/mysql/conf.d/ !includedir /etc/mysql/mysql.conf.d/) So I decided to add at the end of the file “bind-address=0.0.0.0” since it was nowhere there. But my mysql won’t start with this line at this file. I’ve waited couple of minutes and It couldn’t start. When I deleted this line it started immediately.
What can I do now to make connections from public IPs possible?
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.
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.
Click below to sign up and get $200 of credit to try our products over 60 days!