[CentOS] Upgrading MySQL from 4.1 to 5

Wed Apr 16 02:27:42 UTC 2008
Bart Schaefer <barton.schaefer at gmail.com>

On Tue, Apr 15, 2008 at 3:19 PM, Tito Valentin <daemonracing at gmail.com> wrote:
>
> I am trying to upgrade MySQL on CentOS 4.5 but having a hard time.  I need
> to go from MySQL 4.1 to 5.

Having gone through this process about 7 months ago:  It's not
recommended to do a "binary upgrade", that is, to simply install the
newer mysql server and attempt to continue using the same database
files.  Depending on which storage engines you're using, it can fail
rather spectacularly.

Instead you should:
- stop all clients accessing the mysql 4 server
- flush tables and run a full mysqldump
- shut down the mysql 4 server
- make a backup of /var/lib/mysql
- completely remove /var/lib/mysql
- remove mysql 4 and install 5
  (you can do this in one operation with "rpm -Uvh ...")
- start up the mysql 5 server and configure root password etc.
- reload the dump from the first step
- follow the instructions in the online mysql documentation to update
grants etc.

Also pay careful attention to the changes in timestamp column
behavior, default characters sets and collations, etc.  There's
extensive documentation on the mysql website, but it's not really all
in one place and may take some digging.