Uninstalling MySQL on Mac OS X Leopard

To uninstall MySQL and completely remove it from you Mac do the following:

  • sudo rm /usr/local/mysql
  • sudo rm -rf /usr/local/mysql*
  • sudo rm -rf /Library/StartupItems/MySQLCOM
  • sudo rm -rf /Library/PreferencePanes/My*
  • edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
  • sudo rm -rf /Library/Receipts/mysql*
  • sudo rm -rf /Library/Receipts/MySQL*

The last two lines are particularly important as otherwise, you can't install an older version of MySQL even though you think that you've completely deleted the newer version!

21 Responses to “Uninstalling MySQL on Mac OS X Leopard”

  1. 1 LeopardUser

    Extremely helpful. Thank you!

  2. 2 Ken

    Perfect... Thanks

  3. 3 Juan Manuel Saiz

    thanks a lot it works properly.

  4. 4 Rob...

    I'm glad it has helped others too!

    Regards,

    Rob...

  5. 5 Ryan

    I had been struggling over my install for a while, and thanks to this post I was able to start over. Thank you so very much!

  6. 6 valleyman

    Thank you! Exactly what I was looking for :)

  7. 7 Matt J.

    Thank you so much! This has been driving me nuts for the last couple of days.

  8. 8 Anil Wadghule

    Thank you! It really saved my day!

  9. 9 Sunbreaks

    THANK YOU!!! I would kiss you if I could :)

  10. 10 Adriel

    Thanks a lot! This is the only source I've found with great instructions on removing MySQL installs.

  11. 11 tim

    Saved me a ton of time. Thanks a lot!

  12. 12 Brian

    Holy cow, thanks! Somehow the root account got screwed up and had to reinstall, this was perfect.

  13. 13 Tom

    This is excellent ... many thanks!

  14. 14 Mohamed Aslam

    Awesome! Thank you very much.

  15. 15 Abder-Rahman

    Thank you very much. It worked properly.

  16. 16 Jacqui Orr

    Hi Rob,
    After hunting high and low on the web, I came across your website. Great to find somebody that can write clearly and plainly about techie issues.

    Wonder if you can help me? I'm using Tiger V10.4.11, and after several disastrous attempts to install MySQL on my Mac before discovering MAMP, I followed your steps above. I then installed MAMP and my Apache server works fine but the MySQL server fails to start. Question is - should I move to Leopard (and would this solve my problems) or is there something else peculiar to Tiger that I have to do...
    Yours baffled
    Jacqui

  17. 17 Geoff Hogg

    At least I can have another attempt at MySQL on OS X without having to do a complete reinstall.

  18. 18 Tom Rectenwald

    Thank you for posting this; it helped me out. A couple of small things I noticed while running through the steps (OS X 10.5.7 / MySQL 5.1.34 x86_64 Pkg):
    1. If you chose to install mySQL for 'this user only' then you'll want to delete the MySQL.prefPane directory from ~/Library/PreferencePanes rather than the system /Library/PreferencePanes.
    2. The /usr/local directory doesn't exist with a default OS X installation. Provided that you haven't installed other applications that use it (check this first!), you can remove the entire /usr/local (rm -rf /usr/local).
    3. I did notice that mySQL will create /usr/local if it doesn't exist, and /usr/local/include (though it is left empty), and /usr/local/lib with some Pkg directive that can be removed as well.

  19. 19 Rob...

    Thanks for the info, Tom!

    Regards,

    Rob...

  20. 20 asylum

    Thank You for sharing your wisdom
    I hope this gets me back up and running so that i can sleep....

    Brett

  21. 21 Steve

    Thanks for the tips, Rob - much appreciated.

    Just one note, possibly related to my problematic mySQL install (from package), there was nothing related to change in my /etc/hostconfig (10.5.7, mysql-5.1.35-osx10.5-x86_64)

The views expressed in these comments are not the views of the publisher. However, we believe in the rights of others to express their legitimate views and concerns. Any legitimate complaint emailed to rob@akrabat.com will be seriously considered and the post reviewed as desirable and necessary.

Leave a Reply

Buy now!