Identify MySQL version in MySQL Command Line Prompt


If you are in MySQL prompt and want to know which version of the database you are using, you can make use of below queries,

mysql> select version(); 

+-------------------------+
| version()               |
+-------------------------+
| 8.0.28-0ubuntu0.20.04.3 |
+-------------------------+

1 row in set (0.01 sec)

Know installed mysql version using queries

You can also find the details by looking at the variable name version

mysql> show variables like 'version';
+---------------+-------------------------+
| Variable_name | Value                   |
+---------------+-------------------------+
| version       | 8.0.28-0ubuntu0.20.04.3 |
+---------------+-------------------------+
1 row in set (0.01 sec)

One other way is to quit and come out of mysql prompt and once you login you will see the version details,

mysql> quit
Bye
root@b2391b608026:/# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 8.0.28-0ubuntu0.20.04.3 (Ubuntu)

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

mysql> 


















Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap