After installing MySQL on a Mac OSX with a simple Install application, uninstalling it is not as simple as it should be. There are left-overs spread in a couple of folders that may prevent you from even installing the same version again.
A simple solution may prevent you from losing a lot of time dealing with the Installation Failed error codes.
Let’s start to uninstall MySQL. It’s not that hard.
If you haven’t yet rebooted your computer, the process could still be running. First, reboot.
Then if MySQL is still showing up after a reboot, from the Terminal, issue the following commands one at a time1:
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
And using your text editor of choice:
Edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
If you still cannot install or run a different version of MySQL, you might have to issue one last command in the Terminal:
sudo rm -rf /var/db/receipts/com.mysql.mysql*
All this is rather unpleasing thinking that Oracle is not prioritising a proper uninstall since there are so many issues found with the current one. Also, these problems are usually blocking the user from installing any other versions, so is the OSX market so insignificant to let it just pass by? Probably yes, but I just had higher expectancies.
What do you usually do in order to completely uninstall MySQL? Have you encountered other issues or your uninstall usually works smoothly?Follow @bytearrays