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
# 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


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

socket = /var/chroot/www/run/mysql.sock
socket = /var/chroot/www/run/mysql.sock

Quite simple when you finally find the correct file locations… :)

Author: Joel Carnat

@work Technical Architect and SysAdmin ; @home OpenBSD and FOSS, Karate, Kobudō, Jōdō, Bodyweight workout, Photography & Music

One thought on “Tune MySQL on NetBSD and OpenBSD”

  1. 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 *


This site uses Akismet to reduce spam. Learn how your comment data is processed.