macOs MySQL

Install MySQL on Mac

Install MySQL using Homebrew, open the terminal an type in:

$ brew install mysql

Start MySQL server by typing

$ brew services start mysql

Secure the server by typing

$ mysql_secure_installation

When using brew services start mysql the server will re-start at OS reboot, if you run:

$ brew services stop mysql

This will stop MySQL and not re-start after a OS reboot.

You can also avoid this by typing:

$ mysql.server start

This will start MySQL and keep it running until computer shutdown or by typing:

$ mysql.server stop

Connect to server

$ mysql -u root -p

Leave a Reply

Your email address will not be published. Required fields are marked *