07 November, 2010

Removing MYSQL completely from OSX

Today I was running through hell to find out how to remove mysql completely from OSX. Why I wanted to do this is to I installed a wrong version of MySQL on my mac, and wanted to downgrade it, and when I try to install the older version it never allows me to install and says there is a newer version installed on my disk, and therefore cant let me install the one I am trying to do.

alright here is the trick

follow these steps and it should remove mysql from your machine.

1. Make sure you have killed mysql
2. Delete the mysql folder in the local folder ( sudo rm -Rf /usr/local/mysql and sudo rm -Rf /usr/local/mysql* )
3. Remove mysql references from the StartupItems ( sudo rm -Rf /Library/StartupItems/MySQLCOM )
4. Remove it from the PreferencesPanes ( sudo rm -Rf /Library/PreferencePanes/My* )
5. Edit the host config ( vi /etc/hostconfig ) file with VI editor or any text editor you prefer and remove the line MYSQLCOM=-YES-
6. Most importantly you have to delete every mysql related file from the receipts folder ( cd /var/db/receipts/ AND cd /Library/Receipts/ )

These steps have to solve the issue. It worked for me anyway.