How to check MySQL version number

In this tutorial I will explain how to check MySQL version number in different ways. MySQL provides some features for particular version numbers and on particular platforms only. So, in some situations it gets really important to find the MySQL version number installed. If you are faced with such a problem you can use any of the following techniques to find MySQL version number.

I am going to show you how to find MySQL version number using the following tools and techniques:

Using MySQL client (e.g CLI, Query Browser) to check MySQL version:

If you are using a MySQL client e.g. MySQL command line or Query Browser, you can simply execute the following query.

SELECT version();

OR

SELECT @@version;

Output:

mysql> SELECT @@version; +------------+ | @@version | +------------+ | 5.0.67-log | +------------+ 1 row in set (0.00 sec) mysql> SELECT VERSION(); +------------+ | VERSION() | +------------+ | 5.0.67-log | +------------+ 1 row in set (0.01 sec)

You can also use the STATUS command in MySQL cli tool to find MySQL version number (output truncated)

mysql> SHOW GLOBAL VARIABLES LIKE '%version%'; . . mysql> STATUS; -------------- mysql Ver 14.12 Distrib 5.0.67, for redhat-linux-gnu (x86_64) using EditLine wrapper . . --------------

Using MySQL Administrator (free GUI tool) to check MySQL version:

OR if you have access to MySQL Administrator and you are connected to the server. Just click on "Server Information" on the left side pane. The version information will be displayed on the right side pane.

MySQL Administrator server version number check

Using mysqladmin to check MySQL version:

You can also find the version number using mysqladmin command line tool. mysqladmin will also provide you good information about the server e.g. uptime, open tables etc.. Here is how I ran it on my windows machine.

C:\>mysqladmin -uroot -p -hlocalhost version Enter password: ******** mysqladmin Ver 8.42 Distrib 5.1.30, for Win32 on ia32 Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL license Server version 5.1.30-community Protocol version 10 Connection localhost via TCP/IP TCP port 3306 Uptime: 4 days 22 hours 54 min 31 sec Threads: 3 Questions: 1412 Slow queries: 0 Opens: 537 Flush tables: 1 Open tables: 0 Queries per second avg: 0.3

Using phpMyAdmin:

Click on home icon on the top-left corner of any page or click on "Server:<hostname>" link at the very top. You should see MySQL server's version number on the right side of the page (something like the image below).

MySQL server version number check using phpmyadmin

Please feel free to use the comments form below if you have any questions or need more explanation on anything. I recommend thoroughy testing on a production-like test system first before moving to production. Use the icons below to share this tutorial with your friends.

tags cloud

mysql version tricks check tips

popular searches

Comments (write a comment):

That just came in super useful, THANKS! Posted by: Coach on Apr 23, 2011

This is really cool but I have a question. What is the '@@' syntax used in the SQL line?

Thanks any way! Posted by: Khalid on Oct 02, 2011

@@ is how mysql designates internal variables, special vars that hold shit like that (version, basedir, logs,...) Posted by: shoki on Feb 14, 2012

Thanks much for sharing! Posted by: sannidhi on Apr 02, 2012

You can also check the "mysql.version.h" file in the *mysql_path*include folder (in Windows at least) Posted by: Sum Goodfella on Jan 14, 2013

leave a comment