A Fresh Cup is Mike Gunderloy's software development weblog, covering Ruby on Rails and whatever else I find interesting in the universe of software. I'm a full-time Rails developer and contributor, available for long- or short-term consulting, with solid experience in working as part of a distributed team. If you'd like to hire me, drop me a line. I'm also the author of Rails Rescue Handbook and Rails Freelancing Handbook.

Navigation
« Rails 2.2 Migration Goodies | Main | Double Shot #306 »
Monday
Oct062008

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

Reader Comments (1)

[...] Upgrading MySQL 5.0 to 5.1 on OS X [...]

PostPost a New Comment

Enter your information below to add a new comment.
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>