How to Install MySQL natively on Apple Mac M1

MySQL is an open-source and the most popular relational database management system in the world. The name of MySQL is the combination of the “My” which is the name of Michael Widenius’s daughter and SQL is the abbreviation for Structured Query Langauge.

MySQL is a relational database, In the relational database, data is stored into one or more tables, and tables may be related to each other. In the relational database system, we can create a relation between data, this relationship helps to structure the data. SQL is a Structured Query Language used to perform the create, update, read, and delete actions on the database.

If you download the MySQL pre-build x86 binary package directly from the MySQL website and install it on your Apple Mac M1 computer; Although MySQL will run on your MAC, it will run under Rosetta emulation.

To run the MySQL natively as an ARM64 executable, you need to install the MySQL natively. In this guide, we will walk you through how to install MySQL natively on Apple Mac M1.

How to Install MySQL natively on Apple Mac M1

To install MySQL natively on the Apple Mac M1 computer. First, you will need to install the Homebrew package manager. We already have a detailed guide about how to install Homebrew on Apple Mac M1.

Once you have successfully installed Homebrew on your Mac computer, then open the Terminal and make sure the terminal is not running under Rosetta.

To check whether the Terminal is running under Rosetta emulation. Open the Terminal info, and make sure the option called “Open using Rosetta” is unchecked.

In the Terminal, enter the following command and then hit the enter button.

brew install mysql

This command will install MySQL natively on your Apple Mac M1 computer.

This installation process may take a little while because homebrew builds the package from the source code if the pre-build binary is not available.

Once the installation is finished, you can use MySQL. Use the following command to start and stop the MySQL service.

  • Start MySQL – sudo mysql.server start
  • Stop MySQL – sudo mysql.server stop
  • Restart MySQL – sudo mysql.server restart
  • Check status – sudo mysql.server status

Now you have successfully installed MySQL natively on your Apple Mac M1 computer. To check the type of the MySQL package, find the directory where MySQL is installed using the “which mysql” command, then use the command “file package-name” to check the type of the package.

How to Uninstall MySQL

To uninstall MySQL completely, open the Terminal and run the command “brew uninstall mysql”. This command will uninstall the MySQL package from the computer.

Now, go to the /opt/homebrew/var and delete the mysql directory using the command “sudo rm -rf MySQL”. Now, MySQL is no longer available on your computer.

I hope this guide is helpful for you. If you have any feedback; feel free to mention it below in the comment section.

2 thoughts on “How to Install MySQL natively on Apple Mac M1”

Leave your reply here

Scroll to Top