Fixing MySQL with a comment in the config file

A customer called with an emergency issue: A server that normally runs many MySQL instances wouldn’t start them up. Not only would it not start all of them, it wouldn’t even start the first one. The multiple instances were started through the mysql_multi init script. Perhaps you already know what was wrong!

It turns out that this server’s /etc/init.d/mysql_multi wouldn’t start unless it found the text “mysqld_multi” in the /etc/my.cnf file. Not a [mysqld_multi] config file section, but the text string “mysqld_multi”. It was using this text as a proxy for “I found a [mysqld_multi] configuration section.” This was a rather brittle test, as you can imagine.

After reading the source, I determined that the my.cnf file was fine and the configuration should not be changed, and I could not understand what had changed since it was previously working. Perhaps an automated upgrade or a similar change to the system had broken it.

The fix was to place the following comment into the file.

That’s the only time I can recall fixing software by putting a comment into its configuration file. Unfortunately I don’t recall what Linux distribution this was on; I just checked a recent download, and the official MySQL distribution contains a file called mysqld_multi (note the different name) that doesn’t contain this error-prone test.

Share this post

Comments (5)

  • Kris Buytaert

    That’s why you need to tell your clients to use a configuratio management framework such as chef or puppet.. they won’t be able to accidently change config files and break stuf 🙂

    February 4, 2011 at 7:02 am
  • Patrick Casey

    Or, alternately, they’ll break it once and it’ll propagate *everywhere*, bringing down the whole farm :).

    February 4, 2011 at 9:17 am
  • Jeremy Cole

    Patrick: I wish this blog had “Like” buttons. 😉

    February 4, 2011 at 10:55 am
  • Steve Thair

    aaahhh automation, helping you make more mistakes, faster 🙂

    February 4, 2011 at 11:29 am
  • howard

    I test in 5.0.27,have not found this problem

    February 18, 2011 at 3:47 am

Comments are closed.

Use Percona's Technical Forum to ask any follow-up questions on this blog topic.