rightscale/cookbooks_public — pull request #16 by rgeyer (2012-03-12 23:58:58+00:00)
Title: Enable mysql conf.d includes for all OS's

The my.cnf.erb template previously excluded the !includedir statement on centos, rhel, and suse because the server installation package did not create the /etc/mysql/conf.d directory.

I added a directory resource to create the directory, and removed the condition in the my.cnf.erb template. This allows the same functionality (the extension of the mysql config file using a conf.d dir) on all OS's.

In particular, I am using this to change the binlog_format from "STATEMENT" to "ROW" for a particular server I'm setting up.

I branched from commit 9da3ca592c441cb1ef1bb50e7cc2bffb2d570d33 and Rev 87 of the DB Manager, both representative of the latest stable build.

To test, run the following bash/RightScript on the DB manager. If it succeeds (exit 0) then the custom config was successful, otherwise there was some problem.

```bash
#!/bin/bash -e

cat <> /etc/mysql/conf.d/binlogformat.cnf
[mysqld]
binlog_format = ROW
EOF

/etc/init.d/mysql restart

binlog_format=`echo "show variables like 'binlog_format'" | mysql | grep ROW`

if [ -z "$binlog_format" ]
then
exit 1
else
exit 0
fi
```