I wanted to test the new MySQL 5.5.6 on Mac OS X 10.6.4. It’s got problems, so I chose to downgrade to the current stable release of MySQL (5.1.51-community). I ran into bad news though, as the installer refused to progress, complaining that a newer version was already installed.
Here’s how I got rid of the old one:
NOTE: This will delete all your databases. If you do not want to lose everything, stop reading, put your hands by your side, and step away from the keyboard.
If you have data in your databases you wish to keep, you must back up your databases to text files using mysqldump.
Your MySQL installation may have written to your /etc/hostconfig file. If so, you need to edit it and change “YES” to “NO” in this line:
Stop the database server, then open terminal and enter the following commands:
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
sudo rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /var/db/receipts/com.mysql.*