How to perform clean Uninstall of MySQL in Mac


Please follow the below steps

  1. Open the Terminal
  2. Use mysqldump to backup your databases
  3. Check for MySQL processes with: ps -ax | grep mysql
  4. Stop and kill any MySQL processes
  5. Remove files:
  6.                     
                            sudo rm /usr/local/mysql
    sudo rm -rf /usr/local/var/mysql
    sudo rm -rf /usr/local/mysql*
    sudo rm -rf /Library/StartupItems/MySQLCOM
    sudo rm -rf /Library/PreferencePanes/My*
    
                        
                    
  7. Remove previous MySQL Configuration:
  8.                     Remove previous MySQL Preferences:
                    
                        
                            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*
    
                        
                    
  9. Restart your computer just to ensure any MySQL processes are killed
  10. Try to run mysql, it shouldn't work