Which version is my MySQL?


You can use two approaches to know the version of MySQL. In the first approach, you can use version() to know the MySQL Server version. The first approach is as follows

SELECT VERSION();

In the second approach, you can use SHOW VARIABLES command to know the MySQL version. The second approach is as follows

SHOW VARIABLES WHERE Variable_name = 'version';

Let us learn about both the syntaxes one by one.

Using version()

mysql> select version();

The following is te output displaying the current version of the MySQL you are using

+-----------+
| version() |
+-----------+
| 8.0.12    |
+-----------+
1 row in set (0.00 sec)

The second approach is as follows

mysql> SHOW VARIABLES WHERE Variable_name = 'version';

The following is the output displaying the version

+---------------+--------+
| Variable_name | Value  |
+---------------+--------+
| version       | 8.0.12 |
+---------------+--------+
1 row in set (0.01 sec)

Updated on: 30-Jul-2019

94 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements