Upgrading MySQL 5.0 to 5.1 on OS X
I'm too lazy to build from source if there's not a good reason, and for running MySQL on OS X, I've yet to come across a good reason. So, I just use the MySQL Community downloads. Over the weekend I upgraded from 5.0.37 to the latest 5.1 download, because I was hard up against a MySQL bug that was fixed in later builds.
Unfortunately, while just running the installer for 5.1 worked great, it pointed the new server at a brand new set of databases - orphaning the couple of dozen databases I was working with. This was Not Good. The fix comes in two parts.
First, create /etc/my.cnf, with a single entry pointing to the old database files:
[mysqld]
datadir=/usr/local/mysql-5.0.37-osx10.4-i686/data
Second, tell MySQL to upgrade the files:
sudo mysql_upgrade -u root
Unfortunately, while just running the installer for 5.1 worked great, it pointed the new server at a brand new set of databases - orphaning the couple of dozen databases I was working with. This was Not Good. The fix comes in two parts.
First, create /etc/my.cnf, with a single entry pointing to the old database files:
[mysqld]
datadir=/usr/local/mysql-5.0.37-osx10.4-i686/data
Second, tell MySQL to upgrade the files:
sudo mysql_upgrade -u root