MySQL is the most popular open-source RDBMS (Relational Database Management System) alongside its drop-in replacement MariaDB. Therefore, it is important to know the version of MySQL you are running on your computer. In addition, different versions have different compatibility capabilities, thus knowing the version you are running on your PC.
Since its inception, there have been several versions of MySQL with distinct features; hence it is vital to be informed about the version you are running on your PC. For instance, older versions of MySQL have lesser capabilities compared to the latest versions. This article tutorial will aid you in learning how to check the MySQL version.
Some applications are version-specific. Hence you will be required to install a specific version of MySQL to run that application. In such cases, you first have to find out the correct version of MySQL before progressing to the installation process.
Stick to this article if you intend to know how to check the version of MySQL installed in your system.
Note: The latest version of MySQL at the time of writing this article is MySQL 8.0.26 that was released on July 2021. As we know, many older releases are fully supported that you can check out. Also, there might be newer releases that could be released in the future.
There are various ways one can use to check the version of MySQL installed in their operating system, as highlighted below:
How to check MySQL version from the command line
This is the easiest option of checking the MySQL version. Open your terminal and input the command below:
Note: The MySQL server binary is known as mysqld. Therefore, to get the server version, executer the binary with the help of the –version or -V statements as shown below:
Note: The command executed above will output the version of MySQL installed then it will exit.
mysqladmin can be used to query the MySQL version since it is a client utility used to perform administrative operations on the database servers.
Execute the command below to check the installed MySQL version using the mysqladmin utility:
Checking MySQL version from the MySQL Shell
The MySQL utility command client is used to determine the version of MySQL installed in your operating system
Connect to MySQL server by typing in the following command on the MySQL shell
Once the server has been connected to the MySQL shell, the MySQL version will be printed on the screen as displayed in the image below:
Note: to obtain more information about the MySQL installed version and all its accompanying components, use the query version variables as shown:
SHOW VARIABLES LIKE "%version%";
This will output more info about the installed MySQL version plus the accompanying components.
In addition to the mentioned commands, several other commands can help show the MySQL version. For instance, if you run the command below, it will display the MySQL version only
SELECT VERSION ();
When you use the status command, it will display both the server status plus the MySQL version. To use the status command, execute the following command:
Check MySQL version using MySQL Workbench
MySQL Workbench, which in most cases is referred to as a MySQL GUI, is another method that can be used to check the version of MySQL installed in your system. Connect to the server with the help of MySQL workbench the follow the steps highlighted below:
Step 1: Click on the server on the MySQL workbench main menu.
Step 2: Click on “Server Status.” The server status will display both the server information and MySQL version.
Note: If you have not installed and configured MySQL on your operating system, refer to “How to install and configure MySQL on Ubuntu” if you use Ubuntu and “How to install MySQL on Windows” if you are a Windows user.
How to check MySQL version using MySQL Administrator (A Free GUI tool)
First, ensure you have MySQL Administrator and you are connected to the server. You can download MySQL Administrator from here then follow on-screen instructions to install it to your operating system. After successful connection, click on “Server Information,” which can be found on the left side pane. The server info will be displayed, plus the MySQL version.
Note: The development of MySQL administrator has been discontinued making MySQL workbench the official and major GUI tool.
How to check MySQL version using mysqladmin plus the command line
The MySQL version can be checked using the mysqladmin statement from the command line. The mysqladmin provides server version information and other helpful information about the server, such as uptime, open tables, and many more. Execute the following command to check MySQL version using mysqladmin statement.
mysqladmin -uroot -p -hlocalhost version
How to check MySQL version using phpMyAdmin
This is among the most efficient ways of checking the version of MySQL installed in your system if you don’t have access to the server via SSH.
The language used in this stage is PHP. PHP admin is a free and open-source program used to manage and maintain MySQL; therefore, you don’t need to worry about spending any bucks to use the service. Besides, please don’t freak out since we shall not get into deep detail concerning PHP as we aim to check the existing version of MySQL only.
This tutorial assumes you have PHP installed and set up in your operating system. If not, refer to “How to install phpMyAdmin with Lamp stack on Ubuntu.” This article has comprehensively covered all the steps required in installing phpMyAdmin once the installation process has been completed, now login to your hosting account, and open PHP Admin.
On the right side of the “phpMyAdmin” homepage, you will see the “Database server.” Under that pane, you will see the “Server version” of MySQL installed onto your operating system as shown below: