mysql won't start after bind-address change

December 3, 2015 1.8k views
MySQL DigitalOcean Ubuntu

Hello.

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?

1 Answer

OK. I am just a moron.
The file I need to edit is actually /etc/mysql/mysql.conf.d/mysqld.cnf
I could notice that by included directories
Case Solved :)

  • I made an account just to thank you for this comment. I was having the same problem and trying the same steps. You saved the day. You're the best. Thanks!

Have another answer? Share your knowledge.