Posts Learn Components Snippets Categories Tags Tools About
/

How to Install MySQL on macOS Monterey

Get to know how to install MySQL on your macOS Monterey by following our step by steps guides

Created on Dec 04, 2021

12507 views

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

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

Load comments for How to Install MySQL on macOS Monterey

new

PostSrc Code Components

Collection of Tailwind CSS components for everyone to use. Browse all of the components that are right for your project.

View Components

Sponsors 👑

+ Add Yours
)