Tune MySQL on NetBSD and OpenBSD

powered by MySQLFor quite a few days now, in my “optimize than damm WordPress” quest, I’m playing with Ubuntu, NetBSD and OpenBSD in (VMware Fusion) virtual machines and spare hardware I have. One of the idea is to optimize MySQL on those systems. The MySQL configuration file in named my.cnf and is not located in the same place on every systems…

NetBSD and my.cnf

On NetBSD, the configuration examples are located in /usr/pkg/share/examples/mysql/:

# cp -p /usr/pkg/share/examples/mysql/my-large.cnf /usr/pkg/my.cnf
# vi /etc/rc.conf
(...)
mysqld=YES
(...)
# vi /etc/rc.local
(...)
/usr/pkg/share/examples/rc.d/mysqld start
(...)

OpenBSD and my.cnf

On OpenBSD, the configuration examples are located in /usr/local/share/mysql/:

# cp -p /usr/local/share/mysql/my-large.cnf /etc/my.cnf
# vi /etc/rc.conf.local
(...)
mysqld_flags=""
rc_scripts="mysqld"
(...)

Commons

One of the things I customized are the socket reference to deal with chroot modes:

(...)
[client]
socket = /var/chroot/www/run/mysql.sock
(...)
[mysqld]
socket = /var/chroot/www/run/mysql.sock
(...)

Quite simple when you finally find the correct file locations… 🙂

1 Comment

  • Joel Carnat Wed, 27 Jul 2011 11:22:52 +0000 Reply

    By the way, since the MySQL socket is changed in my.cnf to fit into the Apache chroot, PHP also has to be taught about this location.

    On OpenBSD, this is done by adding

    mysql.default_socket = /run/mysql.sock

    to the conf/php5/mysql.ini file.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

%d bloggers like this: