[CentOS] Tuning MySQL - what's the best place for mysqld parameters?

Wed Nov 13 23:43:26 UTC 2013
Patrick Flaherty <pflaherty at wsi.com>

On Mon, Nov 11, 2013 at 1:48 AM, Alexander Dalloz <ad+lists at uni-x.org>wrote:

> Am 11.11.2013 10:37, schrieb Alexander Farber:
> > Hello CentOS users,
> >
> > for a Wordpress website I have installed
> > mysql-server-5.1.69-1.el6_4.x86_64 and
> > run /usr/bin/mysql_secure_installation on
> > a CentOS 6.4 machine with mucho RAM (32 GB)
> > and I wonder, what would be the best place
> > for the mysqld parameters descibed at
> > http://dev.mysql.com/doc/refman/5.1/en/server-parameters.html
> >
> > mysqld_safe --key_buffer_size=64M --table_open_cache=256 \
> >            --sort_buffer_size=4M --read_buffer_size=1M &
> >
> > Should I just edit the file /etc/init.d/mysqld or is
> > there a better place in CentOS for that (under sysconfig?)
>
> Don't touch the init script. It would get overridden by a future package
> update.
>
> /etc/my.cnf is the configuration file where you add all the desired
> tuning options. It will not be touched by an update.
>
> For your help the mysql-server package ships with example configurations
> for different setups:
>
> /usr/share/mysql/*.cnf
>

I had my.cnf replaced when it was a symlink. It was a linked to shared
storage (drbd mount). It may have been replaced because the shared storage
wasn't mounted so it was a "broken" link. chattr +i would probably have
kept it from happening. It's an edge case, but it's worth keeping in mind
if you're doing anything cute.