Thursday, February 1, 2007

Upgrading MySQL 3.23 to MySQL 5.0.27 on FC3

RPM Mirror: ftp://mirror.services.wisc.edu/mirrors/mysql/Downloads/MySQL-5.0/


su
cd ~/
wget ftp://mirror.services.wisc.edu/mirrors/mysql/Downloads/MySQL-5.0/MySQL-server-5.0.27-0.i386.rpm
wget ftp://mirror.services.wisc.edu/mirrors/mysql/Downloads/MySQL-5.0/MySQL-client-5.0.27-0.i386.rpm
wget ftp://mirror.services.wisc.edu/mirrors/mysql/Downloads/MySQL-5.0/MySQL-Max-5.0.27-0.i386.rpm
wget ftp://mirror.services.wisc.edu/mirrors/mysql/Downloads/MySQL-5.0/MySQL-shared-compat-5.0.27-0.i386.rpm
wget ftp://mirror.services.wisc.edu/mirrors/mysql/Downloads/MySQL-5.0/MySQL-shared-5.0.27-0.i386.rpm
wget ftp://mirror.services.wisc.edu/mirrors/mysql/Downloads/MySQL-5.0/MySQL-devel-5.0.27-0.i386.rpm
mysqldump -A > all-databases.sql
/sbin/service httpd stop
/sbin/service mysqld stop
yum remove mysql
mv /etc/my.cnf ~/
rpm -iv MySQL-server-5.0.27-0.i386.rpm
rpm -iv MySQL-client-5.0.27-0.i386.rpm
rpm -iv MySQL-shared-5.0.27-0.i386.rpm MySQL-shared-compat-5.0.27-0.i386.rpm MySQL-devel-5.0.27-0.i386.rpm
chown mysql:mysql /var/run/mysqld
chown mysql:mysql /var/lib/mysql
yum install php-mysql
/usr/bin/mysql_fix_privilege_tables
/sbin/service mysql restart


Notes:

Starting from MySQL 5.0.4 the default behaviour is for mysql to start using a new tool called mysqlmanager
mysqlmanager manages multiple instances of mysql on the same machine.

Since previous configurations specified multiple instance configurations in /etc/my.cnf mysql will attempt to start using mysqlmanager - and will fail because mysqlmanager needs to be configured first. solution used here moves the mysql configuration file to the root home dir. this cause mysql to start mysql in safe mode like it used to using default precompiled settings. since new settings need to be introduced anyway it does not make sense to use an old configuration file anyway.