Downgrading MySQL on Mac OS X

I just tried installing MySQL 5.5 on Snow Leopard, using the community .dmg file from mysql.com. I decided to stick with 5.1, so removed 5.5 and then ran the installer for 5.1.55. It gave me this delightful message:

MySQL 5.1.55-community for Mac OS X can't be installed on this disk. A newer version of this software already exists on this disk.

What a crock. Even though 5.5 has been removed, it refuses to let you install an earlier version. To persuade it that 5.5 really has gone, you need to delete a .plist file that the installer leaves behind.

This command should fix it:

$ sudo rm /var/db/receipts/com.mysql.mysql.*

We should all be using Postgres.

I love feedback and questions — please get in touch on Twitter or leave a comment.