Downgrading MySQL from 5.5 to 5.1 on OS X

I recently had a need to setup a new instance of MySQL on my Mac.  I decided to use MySQL 5.5.x since it was, you know, the latest and greatest.  Only to later find out I needed to use MySQL 5.1 instead.  Time to downgrade.

Since I had used the 64-bit DMG from the MySQL Community Server site, the files were installed to default locations, the Oracle documents indicate simply installing right over the current install will work fine:

If you are downgrading within the same release series (for example, from 5.1.13 to 5.1.12) the general rule is that you just have to install the new binaries on top of the old ones. There is no need to do anything with the databases. As always, however, it is always a good idea to make a backup.

Notice this states a downgrade to a minor version.

When I proceeded to install 5.1, I was greeted with an error that would not allow me to install 5.1 over the top of 5.5, a clearly newer version.

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

My first instinct was to try to determine which files were MySQL-related and start to remove them one-by-one.  After a bit of searching around the web I found out the process of uninstalling MySQL can leave behind one particular file or set of files which prevent installing an older major version.  I figured I would start with the least common denominator first, running the command:

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

After rerunning the installation from the DMG, everything went fine.  I did have to rerun the package to create the startup-up item and create the System Preference item.  Do note though, the Oracle document referenced above says there is no need to do anything with the databases, be warned, this was not true in downgrading to a major version..I lost my databases.   Since it was a new install I didn’t care anyway but I thought you should be warned.

I am sure the purest out there will suggest to install from source, but I’m lazy and have better things to do with my time.  I bet you do too and hopefully this will help you.


  • Pedrojera

     I was walking around with this issue for a couple of hours. Removed everything from everywhere EXCEPT this receipts from /var/db….. Damn it!!!
    Thanks a lot,

  • Junk

    This has been a big help. thanks for posting!

  • Oleksii Shurubura

    Thanks for the help!