How to Install MySQL on macOS

Run your own database on your Mac

What to Know

  • Go to MySQL website > Downloads > Community (GPL) Downloads > Community Server > Download.
  • Next, open DMG file > double-click PKG installer > Install/Change Install Location > Install Software.
  • To run MySQL, select Apple logo > System Preferences > MySQL.

This article explains how to download and install the MySQL database onto macOS Catalina (10.15) and macOS Mojave (10.14).

How to Download MySQL for macOS

The MySQL download for macOS Catalina is compatible with macOS Mojave. Here's how to find and download MySQL for macOS.

  1. Go to the MySQL website and select the Downloads option at the top of the screen.

    MySQL website showing the Downloads tab
  2. Scroll down to the bottom of the Downloads screens and select MySQL Community (GPL) Downloads.

    McSQL website showing location of MySQL Community downloads
  3. Select MySQL Community Server.

    MySQL Community Downloads with the Community Server highlighted
  4. Select macOS in the Select Operating System menu.

    Selection of macOS as the operating system for download
  5. Select Download to the right of macOS 10.15 (x86, 64-bit), DMG Archive.

    The Download button for the macOS DMG archive
  6. You see buttons to either log in to your Oracle Web account or sign up for a new one. Select No thanks, just start my download.

    The Start My Download notice for macOS

Once your download is finished, you're ready to start the installation.

The Mac installer doesn't give you a lot of the extras. If you want documentation, sample databases, or a GUI DB explorer, you need to hunt them down yourself.

How to Install MySQL on macOS

The DMG archive for MySQL contains a friendly wizard-style installer. To install MySQL, take the following steps:

  1. Double-click the DMG file to open it.

  2. Double-click the PKG installer.

    The PKG installer for MySQL
  3. The installer initially lets you know it will check for prerequisites. Click Continue to start.

    Installer checks to confirm Mac can run MySQL
  4. The first step of the install contains links to MySQL-related information, such as the documentation. Click Continue.

  5. Accept the software's license, which is the GNU Greater Public License, or GPL. MySQL is open source software. Click Continue to move on.

    Agreement to GNU General Public License
  6. By default, your Mac's main hard drive is the download destination. Click Install to proceed. (If you have other drives and want to change from the main hard drive, click Change Install Location first to place the software elsewhere.)

    Notice of Install location
  7. Enter your password and click Install Software.

    Password entry field and Install button
  8. Wait while the files copy to your Mac.

    The Actual Installation of the MySQL Files Is Pretty Quick.
  9. In the Configure MySQL server screen, click Use Strong Password Encryption. Click Next.

    Use Strong Password Encryption selection
  10. You are prompted for a MySQL root password. The root user is the superuser of the MySQL subsystem. Click Finish when you're done.

The last screen displays a summary and links. The installation is complete.

How to Run MySQL on macOS

Your first instinct to run MySQL after installation might be to open the Applications menu, but MySQL is a server application, so you won't find it there.

  1. Click the Apple logo in the top left corner of the screen and click System Preferences.

  2. Click MySQL to launch it.

    McSQL icon in Mac System Preferences
  3. From here, there are various things you can do:

    • Click the Start MySQL Server button to start and stop the server.
    • Choose whether you want the server to run automatically at startup.
    • Click Initialize Database to reconfigure the default database.
    • Uninstall MySQL.
  4. Click the Configuration tab to set advanced options, including data directories, the location of the error log, or a custom configuration file, if you have one. Click Apply after making any changes.

    MySQL Configuration panel

You're done.

The MySQL database server runs on port 3306 by default. If you plan on connecting to the database from another machine, you may need to adjust your firewall.

You need to dig into the technical details for MySQL to be of much use to you. Be sure to brush up on the fundamentals of SQL.

Was this page helpful?