Sling Academy
Home/MySQL/How to check your current MySQL version (Windows, Mac OS, Ubuntu)

How to check your current MySQL version (Windows, Mac OS, Ubuntu)

Last updated: January 25, 2024

Introduction

Knowing the version of MySQL you are running can be important for compatibility, troubleshooting, and updating. This tutorial will guide you through the different ways to check your MySQL version on Windows, macOS, and Ubuntu systems. Whether you are a beginner or an advanced user, you’ll find a method that suits your skill level.

Checking the MySQL Version in Windows

Using Command Prompt

C:\> mysql --version

This command will output the version information of your MySQL installation. An example of the output is:

mysql  Ver 15.1 Distrib 10.2.14-MariaDB, for Win64 (x86_64)

Using MySQL Command-Line Client

  1. Open MySQL Command-Line Client from the Start menu. You might need to enter your MySQL root password.
  2. Type the following query and hit enter:
SELECT VERSION();

The version of MySQL will be displayed in the result set.

Checking the MySQL Version on macOS

Using Terminal

Open Terminal and type:

$ mysql --version

The output will look something like this:

mysql  Ver 14.14 Distrib 5.7.21, for osx10.13 (x86_64) using  EditLine wrapper

Using MySQL Workbench

MySQL Workbench provides a graphical interface for MySQL services. You can find the version by:

  1. Opening MySQL Workbench.
  2. Connecting to your MySQL instance.
  3. Navigating to ‘Server Status’ under the ‘Management’ section in the sidebar.
  4. The MySQL version is displayed in the ‘Server Information’ area.

Checking the MySQL Version on Ubuntu

Using Terminal

Type the following command into your terminal:

$ mysql --version

The output will display the installed MySQL version:

mysql  Ver 15.1 Distrib 10.1.31-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

Advanced: MySQL Version from the MySQL Prompt

You can also get detailed MySQL version information from within the MySQL shell:

$ mysql -u root -p
mysql> STATUS;

This will present a block of server status information including the version and more.

Using the APT Package Manager

If you installed MySQL through the APT package manager, you can also check the version by running:

$ dpkg -l | grep mysql-server

This will list the installed MySQL server packages along with versions.

Conclusion

Regardless of your operating system, there are several quick and reliable methods to check which MySQL version your server is running. Knowing your MySQL version helps maintain system compatibility and aids in targeted troubleshooting.

Next Article: MySQL 8: Ways to reset root password in Windows

Previous Article: How to interact with MySQL using command line

Series: MySQL Tutorials: From Basic to Advanced

MySQL

You May Also Like

  • MySQL: How to reset the AUTO_INCREMENT value of a table
  • MySQL: How to add a calculated column to SELECT query
  • MySQL: Eliminate orphan rows in one-to-many relationships
  • MySQL: Using R-Tree Indexes for Spatial Data Types
  • How to Create Custom Collations in MySQL
  • Using Hash Indexes in MySQL: A Practical Guide
  • Understanding Full-Text Indexes in MySQL
  • Partial Indexes in MySQL: A Practical Guide
  • MySQL: How to Remove FOREIGN KEY Constraints
  • Using ENUM in MySQL 8: A Practical Guide (with Examples)
  • MySQL: Creating a Fixed-Size Table by Using Triggers
  • One-to-Many Relationship in MySQL 8: A Practical Guide
  • Using Regular Expressions in MySQL 8: The Complete Guide
  • Using Loops in MySQL: A Practical Guide (with Examples)
  • How to Execute an SQL File in VS Code
  • Making use of the JSON_REMOVE() function in MySQL 8
  • MySQL 8: How to count rows in related tables
  • Replication in MySQL 8: A Comprehensive Guide
  • MySQL 8: FIRST_VALUE(), LAST_VALUE(), and NTH_VALUE() functions – Explained with examples