ttomdewit
By:
ttomdewit

After updating bind-address in /etc/msql/my.cnf file MySQL stops working

February 7, 2016 1.5k views
Networking MySQL

Operating System & Droplet information
Ubuntu 14.04.3 x64
1GB Ram
30GB SSD Disk

Steps to reproduce the error
$ sudo apt-get update
$ sudo apt-get install mysql-server
$ sudo mysql_install_db
$ sudo mysql_secure_installation

After updating all packages and downloading/configuring required packages, I tried the following:

$ sudo nano /etc/mysql/my.cnf
Find the bind-address under [mysqld].

I changed the bind-address* to my second Droplet's **Private Network Address. After that, I told MySQL to restart with the following command: sudo service mysql restart and I got the following reply:

mysql stop/waiting
start: Job failed to start

It does work fine when I edit the file back to it's original settings (listening to 127.0.0.1 instead of a Public or Private Network Address).

I've also tried to clear log files, purge the system and re-install everything again (on three or four different Droplets). So far without any luck.

What am I doing wrong? Is this a known issue, maybe?

Articles that I've (tried) to follow:

https://www.digitalocean.com/community/tutorials/how-to-set-up-and-use-digitalocean-private-networking

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-remote-database-to-optimize-site-performance-with-mysql

Various StackOverflow articles that had similar issues, but their solutions haven't worked for me (purging the system, re-installing, etc.).

Thank you in advance.

1 comment
  • Update

    I changed the bind-address* * from 127.0.0.1 to my **second Droplet's Private Network Address. This should be the Private Network Address from my database server.

1 Answer

The order is important, so try this procedure:

  1. while the bind-address is set at 127.0.0.1, invoke 'service mysql stop' and then examine the output of 'service mysql status' to make sure it has stopped
  2. edit the 'my.cnf' and set the bind address to your private network address, and make sure there is no 'skip-networking' in the my.cnf file
  3. invoke 'service mysql start' and soon after 'service mysql status'
  • Hi gndo,

    When you say "edit the 'my.cnf' and set the bind address to your private network address, and make sure there is no 'skip-networking' in the my.cnf file", do you mean the Private Network Address of my database server or my second Droplet (which currently has WordPress running).

    A friend of mine told me to change it to the Private Network Address of my database server, and now all processes/jobs are running.

Have another answer? Share your knowledge.