Install MySQL in Mac

This tutorial will assist you in using Brew to install MySQL on a Mac.

user@hostname ~ % brew install mysql

The above command will help in installing the latest MySQL version available. It will take a few minutes to complete the process. Once installation is completed, run the following command check the mysql version.

user@hostname ~ % mysql –version

To assign a password to the MySQL host, run the following command.

user@hostname ~ % mysql_secure_installation

Now you can connect to the instance by hitting the following-

user@hostname ~ % mysql -u root -pYourNewpassword

In case you are having any issues, run the following command once installation is completed, to initiate the MySQL service.

user@hostname ~ % brew services start mysql

Hope you find this article helpful.

Leave a Reply