🔒 Secure-first SQL Editor with data access control and masking 🎭

How-To

How to install MySQL Shell on Your Mac

Mila
Mila3 min read
How to install MySQL Shell on Your Mac

info

This article refers to the advanced MySQL Shell introduced in MySQL 8.0, if you want to install the advanced MySQL Shell mysqlsh, check out How to install MySQL Client on Your Mac, Ubuntu, Debian, Windows.

MySQL Shell is an interactive JavaScript, Python, or SQL interface for MySQL Server and is a component that you can install separately. It can be installed on your Mac by using Homebrew or the official MySQL Shell package.

Homebrew

To install MySQL Shell using Homebrew, you need to install Homebrew on your Mac first. If you aren’t sure if you have installed Homebrew already, open your terminal and run the following command to check.

brew -v

If you have, the terminal will display something like this:

_

Otherwise, run the following command to install Homebrew first:

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

On successful installation, your terminal will return a few new lines, with one of them stating:

==>Installation successful!

Install MySQL Shell

To install MySQL Shell using Homebrew, run the following command in the terminal:

brew install --cask mysql-shell

The installation will start shortly. You will know it's done when your Terminal returns the following lines:

🍺  mysql-shell was successfully installed!

Start MySQL Shell to verify the installation.

mysqlsh

This output indicates that the installation was successful.

MySQL Shell version

Copyright (c) 2016, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.

Type '\help' or '\?' for help; '\quit' to exit.
 MySQL  JS >

MySQL Shell package

The second way is to download the MySQL Shell for the macOS package.

Select the corresponding Operating System and OS Version of your Mac, and download the package.

_

Double-click the downloaded DMG file, a Finder window will show up.

_

Double-click to extract the .pkg file, and then follow the instructions as shown in the installation wizard.

_

When the installer finishes, it means you have successfully installed MySQL Shell for Mac, feel free to eject the DMG and delete the file.

Start MySQL Shell to verify the installation.

mysqlsh

This output indicates that the installation was successful.

MySQL Shell version

Copyright (c) 2016, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.

Type '\help' or '\?' for help; '\quit' to exit.
 MySQL  JS >

Starting MySQL Shell

You can start MySQL Shell using this command:

mysqlsh

This will start MySQL Shell in JavaScript mode (by default). To connect to a server, check out MySQL Shell Connections.


More MySQL Tools

MySQL Shell provides the advanced capabilities. Meanwhile you can also check out following tools

  1. Classic mysql, still the most widely used MySQL client.
  2. Top MySQL GUI client.
  3. Top MySQL Schema Compare Tool to Diff and Sync Database.
  4. Top Free Open Source SQL Clients.

Jointhe community

At Bytebase, we believe in the power of collaboration and open communication, and we have a number of communities that you can join to connect with other like-minded.

Subscribe to Newsletter

By subscribing, you agree with Bytebase's Terms of Service and Privacy Policy.