Home / Snippets / How to Install MySQL on macOS Monterey
How to Install MySQL on macOS Monterey cover

How to Install MySQL on macOS Monterey

16.6K

2 years ago

0 comments

To install MySQL on macOS Monterey you will need to have Homebrew package manager installed on your machine. Let's get started!

Step 1: Install Homebrew


If you don't have Homebrew you can install it using the command line below.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Step 2: Update Homebrew Repository

Before installing anything, you have to update the homebrew repository first to get all of the latest packages.
brew update  

Step 3: Install MySQL Using Homebrew


Now run the brew install command and specify MySQL as the package to install. Once that's done you need to start the MySQL using the brew services start command.
brew install mysql
brew services start mysql
By default, MySQL comes with a "root" password and now to complete the setup you need to run the MySQL wizard.
mysql_secure_installation

Step 4: Check MySQL status, start and stop


To check the MySQL running states you can run the following commands.
brew services list
From the information displayed you can start, restart and stop MySQL using the following command.
brew services restart mysql
brew services start mysql
brew services stop mysql

Step 4: Access MySQL from Terminal


To test and access MySQL from the terminal you can use the "mysql" command and specify the username and password as you have entered in the installation above.
mysql -u root -p
By now you will have MySQL installed on macOS Monterey. Cheers!

Other Reads

notion avatar

Alaz

Week-end developer currently experimenting with web, mobile, and all things programming.

Topics:

Frontend

Resource

Average

Average

Support Us

If you like our tutorial, support us by being our Patreon or buy us some coffee ☕️

Welcome to PostSrc V3

PostSrc Dark Logo

You have to login to favorite this