Monday, July 9, 2007

Upgrading MySQL Notes

Upgrading MySQL from 4.0 to 4.1 on RHEL WS 3 was not too easy. I had to first back up all of my databases ... and then delete the existing version. I wanted to put my notes here in case I need to do this again since I had to put this together from a few places.

Backed up all of my existing databses
 mysqldump --user jestill --all-databases --password >/home/jestill/mysqldump/JamieDbs.dump
Check what version of MySQL I am actually running
mysql>SELECT version()
Stop the server
cd /etc/rc.d/init.d
sudo ./mysql stop
Copied the existing version to a new name.

Find what I have currently installed for MySQL
rpm -q -a | grep -i mysql
Delete what I had installed:
rpm -e MySQL-bench
rpm -e MySQL-server
rpm -e MySQL-devel
rpm -e MySQL-client
rpm -e mysql-connector-odbc-3.511.12-1
Dowloaded the rpms for my version of Linux from MySQL. Then installed the new rpms after logging on as root
rpm -i MySQL-client-standard-4.1.11
rpm -i MySQL -devel-standard-4.1.22
rpm -i MySQL-server-standard-4.1.22
rpm -i MySQL-shared-standard-4.1.22
rpm -i MySQL-shared-compat-4.1.22
I then started MySQL back up again to check the version.
mysql>SELECT version();
+-----------------+
| version() |
+-----------------+
| 4.1.22-standard |
+-----------------+
1 row in set (0.01 sec)
Since I updated MySQL I also updated DBD::MySQL
cpan
cpan>force DBD::MySQL

No comments: