Skip to content

Brew, a popular package manager for macOS, simplifies the process of installing and managing software like MySQL, a widely-used open-source relational database management system. This guide covers the installation and uninstallation of MySQL using Brew, including the MySQL client and Workbench, in a terminal environment.

Installing MySQL with Brew

Install Homebrew

If Homebrew is not already installed, open the terminal and run:

/bin/bash -c "$(curl -fsSL <https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh>)"

Install MySQL

To install MySQL using Brew:

brew install mysql

Start MySQL Service

Start the MySQL service:

brew services start mysql

Secure MySQL Installation

Run the security script to secure your MySQL installation:

mysql_secure_installation

Install MySQL Workbench (Optional)

For a GUI interface, install MySQL Workbench:

brew install --cask mysqlworkbench

Uninstalling MySQL with Brew

Stop MySQL Service

Before uninstalling, stop the MySQL service:

brew services stop mysql

Uninstall MySQL

To remove MySQL:

brew uninstall mysql

Remove MySQL Data (Optional)

To completely remove MySQL data:

rm -rf /usr/local/var/mysql

Uninstall MySQL Workbench (Optional)

If MySQL Workbench was installed, uninstall it:

brew uninstall --cask mysqlworkbench

Conclusion

Using Homebrew to manage MySQL on macOS offers a streamlined approach for installation, configuration, and uninstallation. This guide should provide engineers with a clear and concise method for handling MySQL on their systems.

Written by

Robert Cooper avatar

Robert Cooper

Senior Engineer at Basedash

Robert Cooper is a senior engineer at Basedash who builds full-stack product systems across SQL data infrastructure, APIs, and frontend architecture. His work focuses on application performance, developer velocity, and reliable self-hosted workflows that make data operations easier for teams at scale.

View full author profile →

Looking for an AI-native BI tool?

Basedash lets you build charts, dashboards, and reports in seconds using all your data.