Mysql cookbook flushes /etc/my.cnf, breaks local socket access

I was just working with the latest ‘mysql’ cookbook, and note that it is now insisting on creating individual mysql instances. That’s fine, but it’s relatively new behavior for those of us who used older major revisions of the cookbook. And one notable result is that it now deletes, and insists on deleting, /etc/my.cnf.

That it breaks local access is documented in the README.md, but how to restore or use socket based access is not. I’ve done a pull request some suggested updates to the README.md at https://github.com/chef-cookbooks/mysql/issues/314, and put in a ticket there. Basically, you have to read /etc/mysql-default/my.cnf or whatever new config file and use the socket setting from there.

The alternative fix, which I hesitate to put in a README.md, is to put a symlink from the single instance “/etc/mysql-default/my.cnf” to “/etc/my.cnf”. That’s a bit nasty, and I’d only use it on hosts with only one MySQL instance. But it works quite well.

Nico Kadel-Garcia
Lead DevOps Engineer
nkadel@skyhookwireless.com

Hi Nico!

Thanks for the README PR.
Merged!

-s

On Thu, Mar 19, 2015 at 12:41 PM, Nico Kadel-Garcia
nkadel@skyhookwireless.com wrote:

I was just working with the latest 'mysql' cookbook, and note that it is now insisting on creating individual mysql instances. That's fine, but it's relatively new behavior for those of us who used older major revisions of the cookbook. And one notable result is that it now deletes, and insists on deleting, /etc/my.cnf.

That it breaks local access is documented in the README.md, but how to restore or use socket based access is not. I've done a pull request some suggested updates to the README.md at Broken local MySQL access notes are unclear · Issue #314 · sous-chefs/mysql · GitHub, and put in a ticket there. Basically, you have to read /etc/mysql-default/my.cnf or whatever new config file and use the socket setting from there.

The alternative fix, which I hesitate to put in a README.md, is to put a symlink from the single instance "/etc/mysql-default/my.cnf" to "/etc/my.cnf". That's a bit nasty, and I'd only use it on hosts with only one MySQL instance. But it works quite well.

Nico Kadel-Garcia
Lead DevOps Engineer
nkadel@skyhookwireless.com