Skip to content

How to Check MySQL Version

Category
Databases
Covers
MySQL
Versions & support
About MySQL →
On this page

MySQL is a relational database management system. At the writing time of this tutorial MySQL, 8 is the latest version available. This tutorial helps you to check the MySQL server version running on your system.

Find Version with mysqld Command

Use mysqld command with -V option to check MySQL version running on local host system. The below examples can only used for the localhost only.

mysqld -V 
Output:
/usr/sbin/mysqld Ver 8.0.25-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu))

The above result shows that you are running MySQL version 8.0.25 on your local system.

Using SELECT VERSION Statement

You can also obtain the version from within the MYSQL shell by typing the SELECT VERSION() statement:

mysql> SELECT VERSION();
Output:
+-------------------------+ | VERSION() | +-------------------------+ | 8.0.25-0ubuntu0.20.04.1 | +-------------------------+ 1 row in set (0.00 sec)

Using SHOW VARIABLES Statement

You can also find the MySQL version information, which is stored in a variable named version. Type the below statement to view the MySQL server version.

mysql> SHOW VARIABLES LIKE "%version%";

MySQL check version

Check MySQL Version During Connecton

You can also check the MySQL version with a log-in to MySQL command-line interface. When we connect to the MySQL shell, it displays a welcome message including the MySQL version running on the system.

This method can be used to check MySQL versions running on localhost as well as on the remote hosts.

mysql -u root -p 

How to Check MySQL Version

Conclusion

This tutorial helps you to check the MySQL version running on localhost or a remote host.

Rahul

Rahul Kumar is the founder and chief editor of TecAdmin.net. A Red Hat Certified Engineer (RHCE), he has worked in IT since 2009, with hands-on experience in Linux system administration, DevOps, web hosting, cloud platforms and automation. He started TecAdmin in 2013 to share practical, step-by-step guides, and leads its editorial work with one aim: making technical learning clear and useful for sysadmins, developers and beginners alike.

Leave a Reply

Your email address will not be published. Required fields are marked *


Back to top