Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to retrieve the current version of a MySQL database management system (DBMS)?

Tags:

mysql

What command returns the current version of a MySQL database?

like image 602
pheromix Avatar asked Jan 24 '12 13:01

pheromix


People also ask

How do I find an existing MySQL database?

Show MySQL Databases The most common way to get a list of the MySQL databases is by using the mysql client to connect to the MySQL server and run the SHOW DATABASES command. If you haven't set a password for your MySQL user you can omit the -p switch.


Video Answer


4 Answers

Try this function -

SELECT VERSION();
-> '5.7.22-standard'

VERSION()

Or for more details use :

SHOW VARIABLES LIKE "%version%";
+-------------------------+------------------------------------------+
| Variable_name           | Value                                    |
+-------------------------+------------------------------------------+
| protocol_version        | 10                                       |
| version                 | 5.0.27-standard                          |
| version_comment         | MySQL Community Edition - Standard (GPL) |
| version_compile_machine | i686                                     |
| version_compile_os      | pc-linux-gnu                             |
+-------------------------+------------------------------------------+
5 rows in set (0.04 sec)

MySQL 5.0 Reference Manual (pdf) - Determining Your Current MySQL Version - page 42

like image 125
Devart Avatar answered Oct 26 '22 18:10

Devart


Many answers suggest to use mysql --version. But the mysql programm is the client. The server is mysqld. So the command should be

mysqld --version

or

mysqld --help

That works for me on Debian and Windows.

When connected to a MySQL server with a client you can use

select version()

or

select @@version
like image 45
Paul Spiegel Avatar answered Oct 26 '22 16:10

Paul Spiegel


try

mysql --version

for instance. Or dpkg -l 'mysql-server*'.

like image 174
Michael Krelin - hacker Avatar answered Oct 26 '22 17:10

Michael Krelin - hacker


Use mysql -V works fine for me on Ubuntu.

like image 29
Umesh Kaushik Avatar answered Oct 26 '22 17:10

Umesh Kaushik