Uninstall MySQL on a Mac

Steps to completely uninstall MySQL from a Mac is a lot more involved than I thought.

Here are the steps:

    Stop the database server
    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-
    rm -rf ~/Library/PreferencePanes/My*
    sudo rm -rf /Library/Receipts/mysql*
    sudo rm -rf /Library/Receipts/MySQL*
    sudo rm -rf /private/var/db/receipts/*mysql*
Uninstall MySQL on a Mac

Reset MySQL root password on Mac

Simple and clear way to update the root password MySQL on Mac:


1) sudo /usr/local/mysql/support-files/mysql.server stop
2) sudo /usr/local/mysql/support-files/mysql.server start --skip-grant-tables
3) cd to /usr/local/mysql/support-files/mysql
4) ./mysql> FLUSH PRIVILEGES;
5) mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
6) Ctrl + z
7) sudo /usr/local/mysql/support-files/mysql.server start
8) /usr/local/mysql/support-files/mysql -u root -p
9) enter the new password i.e MyNewPass

Reset MySQL root password on Mac