To install MySQL on your system, follow the commands below:
- Update Homebrew:
sudo brew update - Install MySQL:
brew install mysql - Start MySQL Service:
brew services start mysql - Restart MySQL Service:
brew services restart mysql - Stop MySQL Service:
brew services stop mysql - Check MySQL Service Status:
brew services status mysql - Cleanup:
brew cleanup - Remove MySQL:
brew remove mysql - Unload LaunchAgent:
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist - Remove LaunchAgent File:
rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist - Remove MySQL Data Directory:
sudo rm -rf /usr/local/var/mysql - Access MySQL:
mysql -u root -p
For efficient MySQL management on your system, utilize the provided commands to install, start, stop, and remove MySQL service, ensuring seamless operation and maintenance of your database infrastructure.





