We are going to use Homebrew to install MySQL and MySQL Workbench.
- In a terminal, check if you have Homebrew installed by
running
brew --version. - If you don't have it installed, go to brew.sh and run the script on the home page in the terminal.
- Run
brew update. - To install MySQL run
brew install mysql. - To start the MySQL service run
brew services start mysql. - Run the security script with
mysql_secure_installation. - When asked about using the validate password component you can select either yes or no. In the video below we select no.
- Enter a password you will use for the root user. Don't lose this password. Nothing will display in the terminal when you type the password.
- Re-enter the password.
- Remove anonymous users? Enter yes.
- Disallow root login remotely? Enter yes.
- Remove test database? Enter either yes or no.
- Reload privileges table now? Enter yes.
- Install MySQL Workbench with
brew install --cask mysqlworkbench. - Open Workbench through Spotlight or the icon in the Applications folder.
- If you don't have a connection when opening Workbench, click the + sign, enter a connection name, leave the user as root, and use the password you entered above.