mysql

Install mysql with homebrew:

brew install mysql

To start mysql now and restart at login:

brew services start mysql

To start mysql server manually:

mysql.server start

By default, homebrew installs MySQL database without a root password. To secure it run:

mysql_secure_installation

The MySQL installed via homebrew is configured to only allow connections from localhost by default.

To connect run:

mysql -u root