How to Check/Display MySQL Version?

MySQL is a very popular RDMS that is very actively used and developed. MySQL is created in 1995 and after that time a lot of versions are released. MySQL’s current major version is 8 and there are minor version numbers that are added after the major version like 10.3 etc. In this tutorial, we will learn how to list the current MySQL database version by using different methods like command-line interface, MySQL interactive shell, PHPMyAdmin, package managers, etc.

Check MySQL Version with mysql Command

The mysql command is used to connect MySQL database and provide an interactive shell in order to manage and use MySQL server. The mysql command also called as MySQL client tool. If the MySQL server is installed in the current system with the mysql command the mysql command can be used to display the MySQL server version. The -V option is used to print MySQL server and client version like below.

$ mysql -V
mysql  Ver 15.1 Distrib 10.3.29-MariaDB

From the output ve can see that the MySQL server versions is 10.3.29 .

Check MySQL Version with mysqld Command

The mysqld is the MySQL server daemon or service executable file which simply runs the MySQL server. It is also called as “server executable”. It can be used to print the MySQL server version. Just call the mysqld executable like below which prints some verbose information that includes the server version.

mysqld
Check MySQL Version with mysqld Command

Check MySQL Version with mysqladmin Command

The mysqladmin command is used to manage MySQL server . Similar to the mysql command the mysqladmin command can be used to print MySQL server version via command line of the operating system. The -V option is used to print MySQL server version information for the local system.

mysqladmin -V
mysqladmin  Ver 9.1 Distrib 10.3.29-MariaDB, for debian-linux-gnu on x86_64

Check MySQL Version with MySQL Interactive Shell Login Banner

The mysql command is used to connect local or remote MySQL server database. After succesfull connection the connected MySQL server login banner provides some basic information that also provides the MySQL server version.

$ sudo mysql -u root -p
Enter password: 
 Welcome to the MariaDB monitor.  Commands end with ; or \g.
 Your MariaDB connection id is 39
 Server version: 10.3.29-MariaDB-0ubuntu0.20.10.1 Ubuntu 20.10
 Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
 Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 MariaDB [(none)]> 

Check MySQL Version with MySQL Interactive Shell Variable

The MySQL interactive shell can be used to print detailed information about the server. The interactive shell provides variables in order to configure and store some useful information. The MySQL server version also provided as a variable with the name of version . The following SQL query is executed in the MySQL interactive shell.

SHOW VARIABLES LIKE "%version%";
Check MySQL Version with MySQL Interactive Shell Variable

Check MySQL Version with MySQL Interactive Shell Status Command

MySQL interactive shell provides different useful commands. The status command is used to print current status of the connection and terminal. The status command also prints the connected MySQL server version in the line Server version .

STATUS;
Check MySQL Version with MySQL Interactive Shell Status Command

Check MySQL Version with phpMyAdmin

The phpMyAdmin is a web based application which is used to manage the MySQL server, databases, tables and data with a GUI. The phpMyAdmin tool is used to connect to the MySQL server which is also provides detailed information about the database server via the main screen.

Check MySQL Version with phpMyAdmin

Leave a Comment