- Install MySQL
brew install mysql - Start it now and on every login
brew services start mysql - Set a root password and remove test data
mysql_secure_installationAnswer the questions. Yes to everything is a good default.
Check it worked
- Log in
mysql -u root -p -e "SELECT VERSION();"
Undo it
- Stop and uninstall
brew services stop mysql && brew uninstall mysql
- Install MySQLNeeds sudo
sudo apt install -y mysql-server - Start it now and on every bootNeeds sudo
sudo systemctl enable --now mysql - Remove test data and lock things downNeeds sudo
sudo mysql_secure_installationOn Ubuntu, root logs in through sudo rather than a password.
Check it worked
- Log in
sudo mysql -e "SELECT VERSION();"
Undo it
- Uninstall MySQLNeeds sudo
sudo apt remove -y mysql-server
- Install MySQL
winget install Oracle.MySQLThe setup window asks you to set a root password. Keep it somewhere safe.
Check it worked
- Log in
mysql -u root -p -e "SELECT VERSION();"If mysql isn't found, open "MySQL Command Line Client" from the Start menu instead.
Undo it
- Uninstall MySQL
winget uninstall Oracle.MySQL