I’m very sorry this has taken so long. I wanted to make sure I had a good description of the instructions and tested it with most of the applications in use. I think I’ve got it nailed which means this instructions will give you a safe way to upgrade your MySQL version.

But as always with MySQL, make a backup of your data before you start messing with MySQL. I try to do my best at offering you a safe instruction set but I’m unable to foresee any combination of soft and hardware you might have installed so it might not work. You can use mysqldump, phpMyAdmin or any other tool you might use.

Alright, backup ready! Here we go…

First download the new 5.1.x packages, at the time of writing that would be 5.1.34. Download the appropriate package for your platform from the section called: “Mac OS X (package format)”. Then from the bottom section called “Source downloads” download the “Compressed GNU TAR archive (tar.gz)” package.

When you are ready you need to stop your current installation of MySQL, but because we made it foolproof and unstoppable (it will restart automatically) we need to do some extra steps:

sudo launchctl stop com.diymacserver.mysql
sudo launchctl unload /System/Library/LaunchDaemons/com.diymacserver.mysql.plist

Now the old 5.0.x installation of MySQL is stopped and you have a backup ready and waiting we can continue.

Open/Mount the disk-image of the 5.1.x version you just download and install MySQL from there by double clicking the installer and follow the instructions.

When you are finished continue with unpacking the 5.1.x source archive you downloaded as well. CD into the directory and execute the following commands:

For 64 bits on Leopard:
CFLAGS=”-arch x86_64″ \
CXXFLAGS=”-arch x86_64″ \
./configure --prefix=/usr/local/mysql \
--with-server-suffix=-standard \
--enable-thread-safe-client \
--enable-local-infile \
--enable-shared \
--with-zlib-dir=bundled \
--with-big-tables \
--with-readline \
--with-plugins=all \
--without-docs

For 32 bits on Leopard:
./configure --prefix=/usr/local/mysql \
--with-server-suffix=-standard \
--enable-thread-safe-client \
--enable-local-infile \
--enable-shared \
--with-zlib-dir=bundled \
--with-big-tables \
--with-readline \
--with-plugins=all \
--without-docs

I’m still working on Tiger but my old Tiger based G4 mini has died and I need to revive it again. Sorry

Followed by:

make
sudo make install

Now to restore all your databases we can do two ways: Quick and dirty or clean. Both will work, but you will need to check your users and passwords afterwords.

Quick and dirty:

Copy the data directory from your 5.0.x installation to the new mysql/data directory.

sudo cp -R /usr/local/mysql-5.0.81-osx10.5-x86_64/data /usr/local/mysql
sudo chown -R _mysql /usr/local/mysql/data/*

Clean:
Startup MySQL and import your backup.

To startup MySQL you can just re-enable the lauchd commands:

sudo launchctl load /System/Library/LaunchDaemons/com.diymacserver.mysql.plist
sudo launchctl start com.diymacserver.mysql

All should be fine.