How to uninstall MySQL on a Mac.
To uninstall MySQL, you can follow these steps:
- Open the “Terminal” application.
- Type in the following command and press enter to stop the MySQL server:
sudo /usr/local/mysql/support-files/mysql.server stop
- Type in the following command and press enter to uninstall MySQL:
sudo rm -rf /usr/local/mysql
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
- Enter the following command and press Enter to delete a MySQL user group and user:
sudo dscl . -delete /Groups/mysql
sudo dscl . -delete /Users/mysql
- Enter the following command and press Enter to delete MySQL related files:
sudo rm -rf /var/db/receipts/com.mysql.*
sudo rm -rf /var/mysql
sudo rm -rf /var/log/mysql*
- Finally, restart your computer.
After completing the above steps, MySQL on your Mac will be completely uninstalled.