In the past, we maintained a script for automating the installation of MySQL on macOS. Over the years, it has become difficult to ensure that the script works on all of the versions of macOS still in use, and support from MySQL for macOS is slow. As a result, we now recommend installing and maintaining MySQL using Homebrew. This allows for easy upgrades, and still includes the ability to have MySQL start on boot. Homebrew is a third party package manager, similar to yum or apt if you’re familiar with Linux package managers. It provides an easy way to install third party software and a way to keep that software up to date.
Before we begin, there are a few prerequisites:
- Xcode must be installed. It can be installed from the App Store here.
- MySQL should not already be installed on your system. If you have installed or attempted to install it before, you will need to make sure MySQL is completely removed along with all of its files and directories.
Install MySql Database Server On Mac. Download MySql Server community version for macOS.; Click the downloaded dmg file to open the MySql server installer package. Click the Next button in the wizard dialog until go to the Change Install Location dialog, then click the Install button to install it. MySQL is a relational database management system. MySQL is the widely used database server in the world. This tutorial helps you to install MySQL database server on macOS Sierra 10.12 and High Sierra 10.13 and other supported versions using Homebrew. I also got the same problem in mac OS X 10.10.4(Yosemite).SET PASSWORD work for me.Alter password for mysql- mysql SET PASSWORD = PASSWORD('yourpassword'); Query OK, 0 rows affected, 1 warning (0.01 sec) set your Mysql environment path variable in.bashprofile and add the below line. Hello Friends,In this video tutorial, you will learn to install mysql database server on mac os x catalina. I have explained the whole process of installatio. Using the official.pkg installer This is the fastest method for installing MySQL on your Mac, but only available for Intel processors. MySQL.com offers a standard MacOS installer package that installs the MySQL Server and several command line utilities. The download also includes a system preference pane for starting/stopping the server.
Let’s get started – the first thing you need to do is open up a terminal window and make sure you’ve accepted the Xcode license agreement by issuing this command:


You will have to press space a bunch of times to scroll to the bottom of the agreement and then type ‘agree’ if you agree to the terms.
Next, we’re going to install Homebrew (this command is all one line):
The installer will give you a list of things it’s going to do, just press enter and Homebrew will be installed.
Now that you have Homebrew installed, you can type check to see if there are any recommendations for your setup:
For example, you may have an outdated version of Xcode, in which case you may want to upgrade that:
Moving on, it’s time to install MySQL. As of the writing of this post, the latest version of MySQL available through Homebrew is MySQL 5.7.20 8.0.12. To install it:
Once the installation completes, we’ll want to take care of a few more things. First, let’s tell it to start automatically whenever we reboot the system:
By default, MySQL is installed without a root password. This is considered insecure, so let’s get one set:
- Validate Password Plugin – you can have MySQL enforce strong passwords by enabling this, but it is optional
- Remove anonymous users – we recommend doing this
- Disallow root login remotely – we recommend doing this as well – if you need to access your databases remotely, this should be done with a specific user with rights to that database
- Remove test database and access to it – we recommend this
- Reload privilege tables now – choose yes

Once we’ve finished this up, MySQL is running on our system. Now we can test it:
You can now manage MySQL databases and users via the command line, or we recommend Sequel Pro for a graphical interface.
To update Homebrew and MySQL in the future, use the following commands:
How To Install Mysql Server In Mac
If you run into any issues, feel free to open a support ticket and we’ll be happy to help troubleshoot.
Download Mysql Server
Update Aug 28, 2018: Homebrew is now installing MySQL 8 by default. When this article was originally written, MySQL 5.7 was the default. While backwards compatibility is usually maintained, some changes in new versions of MySQL can cause badly written PHP scripts to perform differently. Review the notable changes in MySQL 8 here.
