Check MySQL Version on macOS

December 7, 2023

Introduction

Checking the version of MySQL installed on a system helps users verify the system's compatibility with specific MySQL features. The MySQL version also determines whether the database can communicate with some third-party tools and plugins.

This article shows you how to check the MySQL version installed on your macOS system.

Check MySQL version on macOS.

Prerequisites

  • A computer running macOS.
  • MySQL installed.

How to Check MySQL Version on macOS

The steps to find the MySQL version on macOS depend on how MySQL was installed. The first five methods described in this tutorial can be applied to all installation types, while the last (GUI) method is exclusive to the DMG installer.

Find all six methods in the sections below and choose the one that suits your workflow.

Method 1: mysql Command

Every MySQL instance on macOS comes with the command-line interface preinstalled. Follow the steps below to check the MySQL version via CLI:

1. Open Finder and select Applications.

2. Expand the Utilities folder and select Terminal.

Finding Terminal in macOS system settings.

3. Type the following command:

mysql -V

The output shows the installed MySQL version.

Using the mysql command to check the MySQL version.

If you receive an error, the path to the mysql binary may not have been added to the system's PATH variable during the MySQL installation. In this case, follow the procedure below to run the mysql command:

1. Go to MySQL's bin directory:

cd usr/local/mysql/bin

2. Type the following command:

./mysql --version

The version number is printed in the output.

Using the mysql command to check the MySQL version. The command has not yet been added to the path.

Note: Learn how to add a binary path to the PATH variable by reading How to Set Environment Variables in macOS.

Method 2: Console Login

The installed MySQL version is also visible in the welcome message printed out when the user logs in to MySQL using the terminal. Below is the command for logging in:

mysql -u [username]

For example, to log in as the root user, type:

mysql -u root
Checking the MySQL version at the console login.

The command shows the MySQL version number in the Server version field.

Note: The next three methods in the sections below show MySQL version information using the MySQL statements issued from the database prompt. To apply these methods, log in to your MySQL instance first.

Method 3: STATUS Statement

The STATUS statement is a MySQL command that shows the system status, part of which is the version information. Type the command below to output the status message:

STATUS;

Find the version number in the Server version field.

Checking the MySQL version with the STATUS statement.

Method 4: SELECT Statement

The SELECT statement extracts data from a database. Use it to print out the MySQL version number by typing:

SELECT VERSION ();

The command outputs the data in a result table.

Checking the MySQL version with the SELECT statement.

Method 5: SHOW Statement

MySQL stores version information as a variable you can access using the SHOW statement. Enter the following command to print the version variable:

SHOW VARIABLES LIKE '%version';

Look for the version field in the table.

Checking the MySQL version with the SHOW statement.

Method 6: GUI

Lastly, if you installed MySQL using a native macOS DMG installer from the official website, follow the steps below to check the MySQL version via GUI:

1. Open Finder and select the Applications item in the sidebar on the left side of the window.

2. Select System Settings from the list of applications.

Finding System Settings in macOS Finder.

3. Scroll through the sidebar content on the left side of the window until you find the MySQL item. Select MySQL.

4. Find the version number in the Instances section of the MySQL pane.

The MySQL preference pane in macOS System Settings.

Note: For other OSs, refer to our articles Check the MySQL Version on Windows
and Check the MySQL Version in Linux.

Conclusion

This tutorial provided six methods to check the MySQL version installed on your macOS system. The methods included GUI, CLI, and the procedures involving MySQL statements.

Next, check out our downloadable MySQL Command Cheat Sheet and save it for future reference.

Was this article helpful?
YesNo
Marko Aleksic
Marko Aleksić is a Technical Writer at phoenixNAP. His innate curiosity regarding all things IT, combined with over a decade long background in writing, teaching and working in IT-related fields, led him to technical writing, where he has an opportunity to employ his skills and make technology less daunting to everyone.
Next you should read
MySQL Performance Tuning and Optimization Tips
April 25, 2024

This guide provides several tuning tips on how to improve the performance of a MySQL database.
Read more
How to Back Up & Restore a MySQL Database
January 25, 2024

It is essential to important to make regular backups of all data in case of loss. Has your MySQL database has been lost...
Read more
MySQL Show User Privileges
November 6, 2024

MySQL provides methods to create new user accounts and grant privileges over the database. A simple command helps provide valuable information about...
Read more
How To Show a List of All Databases in MySQL
October 13, 2022

Displaying available databases is a common MySQL task. This guide will show you how to list all MySQL Databases via CLI or GUI.
Read more