Upgrading to MySQL 5 [Part 2]

In the earlier post Upgrading to MySQL 5 [Part 1] I have simply reviewed how powerful version 5 is. In this part I will explain how in a typical scenario a DBA can upgrade an existing MySQL4 to MySQL5.

The process normally involves the following steps:

a) shutdown MySQL4 db (/etc/init.d/mysql stop)

b) backup the following files just in case:
- /usr/bin/mysql*
- /etc/mysql/*
- /var/lib/mysql/*

c) download MySQL5 (the non-RPM x86 package) and untar/unzip to ./mysql5. Then install as follows:
- mkdir /usr/local/mysql
- cp -R ./mysql5/* /usr/local/mysql
- cp -R /var/lib/mysql/* /usr/local/mysql/data/
- chown -R mysql:mysql /usr/local/mysql/*

d) startup MySQL5 db:
- cd /usr/local/mysql/bin
- ./mysqld_safe

e) connect to database and confirm that it's ok:
- cd /usr/local/mysql/bin
- ./mysql -u root -p

f) delete backups/old binaries from /usr/bin/

g) smile

No comments: