How to Install MySQL on MacOS



How to Install MySQL on MacOS

How to Install MySQL on MacOS

Are you looking for a step-by-step guide on how to install MySQL on your Mac with an M1 chip? Look no further! In this tutorial, we’ll guide you through the installation process using Homebrew. Homebrew is a popular package manager for macOS that makes it easy to install and manage software packages like MySQL.

We’ll start by showing you how to install Homebrew on your Mac, and then we’ll walk you through the steps to install MySQL using Homebrew. We’ll also show you how to start the MySQL service and access MySQL from your Terminal.

Whether you’re a developer or just getting started with MySQL, this tutorial will help you get up and running with MySQL on your Mac in no time. So, grab your Mac with an M1 chip, open up Terminal, and let’s get started!

To install MySQL on a Mac with an M1 chip, you can follow these steps:

Open Terminal on your Mac. You can find Terminal in the Applications -Utilities folder, or by searching for “Terminal” using Spotlight.

Install Homebrew by running the following command in Terminal:
/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)”

After Homebrew is installed, run the following command to update Homebrew:
brew update

Install MySQL using Homebrew by running the following command:
brew install mysql

Once the installation is complete, start the MySQL service using the following command:
brew services start mysql

You can then access MySQL by running the following command:
mysql -u root

That’s it! You should now have MySQL installed on your Mac with an M1 chip.

How to add MySQL to $PATH variable:
cd to your home folder
$ open -t .bash_profile
Try adding the following line to your .bash_profile file.
export PATH=${PATH}:/usr/local/mysql/bin/

Setting the MySQL root user password on OS X
$ mysql -u root -p
mysql$ ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘MyNewPass’;

Comments are closed.