sudo rm /usr/local/mysql
If you also installed the StartupItem package, you’ll want to remove it as well. Keep in mind that if you ever want to auto-start the old version of MySQL later on, you’ll need to re-download the package installer and reinstall the StartupItem.
sudo rm -rf /Library/StartupItems/MySQLCOM/