Wednesday, November 23, 2005

MySQL 5 On OpenBSD 3.8

Binary Base Installation

Download mysql-standard-5.0.15-openbsd3.7-i386.tar.gz or mysql-5.0.16.tar.gz via

shell>tar xvzf mysql-standard-5.0.15-openbsd3.7-i386.tar.gz
shell>groupadd mysql
shell>useradd -g mysql mysql
shell>cd /usr/local/src
shell>tar xvzf mysql-standard-5.0.15-openbsd3.7-i386.tar.gz
shell>ln -s ./mysql-standard-5.0.15-openbsd3.7-i386 /usr/local/mysql
shell>cd /usr/local/mysql
shell>scripts/mysql_install_db --user=mysql
shell>chwon -R root .
shell>chown -R mysql data
shell>chgrp -R mysql .

Running mysql server

shell>/usr/local/mysql/bin/mysql_safe --user=mysql --basedir=/usr/local/mysql --datadir=/nsm/data \ --pid-file=/usr/local/mysql/data/

Source Base Installation(Special thanks to Transporter for this)

shell>CC=gcc CFLAGS="-02 -fno-strength-reduce" CXX=gcc CXXFLAGS="-02 -fno-rtti -fno-exceptions -felide-constructors -fno-strength-reduce"
shell>./configure --prefix=/var/mysql --enable-assembler --enable-openssl --enable-thread-safe-client

shell>gmake install
shell>chown -R root /var/mysql
shell>chown -R mysql /var/mysql/var
shell>chgrp -R mysql /var/mysql
shell>cp support-files/my-medium.cnf /etc/my.cnf
shell>/var/mysql/bin/mysqld_safe --user=mysql &

I still remember it was a pain to get mysql compiled from source on OpenBSD platform last time and it seems MySQL 5 concerning about OpenBSD users as well and providing Binary installation. If you are sguil users, considered you need to install MySQL 5 from source since mysqltcl requires to compile properly.

No comments: