Mysql Installation
-
openQRM is
certified to work with MySQL 4.1.9 using InnoDB.
-
Make sure you
don't have any other MySQL installed on your openQRM server.
If so,
please uninstall it before proceeding.
-
run the commands:
su - root
cd /tmp
wget http://downloads.mysql.com/archives/mysql-4.1/mysql-standard-4.1.9-pc-linux-gnu-i686.tar.gz
tar -zxvf mysql-standard-4.1.9-pc-linux-gnu-i686.tar.gz -C /usr/local
groupadd mysql
useradd -g mysql mysql
cd /usr/local
ln -s mysql-standard-4.1.9-pc-linux-gnu-i686 mysql
cd /usr/local/mysql
scripts/mysql_install_db --user=mysql
chown -R root .
chown -R mysql data
chgrp -R mysql data
chown -R mysql:mysql /var/lib/mysql
-
Add MySQL as
a service and so that it starts every time the server is booted. For
example on Red Hat systems:
Create
/etc/init.d/mysqld which contains the following:
#!/bin/bash
# chkconfig: - 64 36
# description: MySQL database server.
# Source function library.
. /etc/rc.d/init.d/functions
RETVAL=0
action=$1
prog=mysql
start() {
# Start daemons.
echo -n $"Starting $prog: "
daemon /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf --user=mysql &
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
return $RETVAL
}
stop() {
# Stop daemons.
echo -n $"Shutting down $prog: "
killproc mysqld
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
RETVAL=$?
;;
condrestart)
if [ -f /var/lock/subsys/$prog ]; then
stop
start
RETVAL=$?
fi
;;
status)
status mysqld_safe
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
esac
exit $RETVAL
-
Add MySQL as
a service:
chmod +755 /etc/init.d/mysqld
Note: in /etc/rc.d/rc3.d
qrm-server gets "S98qrm-server" make sure that
mysqld gets a low number like "S97mysqld" we need
to run mysql before qrm-server.
chkconfig --add mysqld
chkconfig --level 2345 mysqld on
chkconfig --list |grep mysqld
-
Use the openQRM mysql config file, create
symlinks, modify the environment:
rm /etc/my.cnf
ln -s /usr/qrm/etc/my.cnf /etc/my.cnf
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
echo "export MYSQL_HOME=/usr/local/mysql" >> /root/.bashrcmkdir -p /var/run/mysql /var/lib/mysql
chmod -R 777 /var/run/mysql
chown -R mysql:mysql /var/lib/mysql
-
start
MySQL:
service mysqld start