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)
- Using MySQL Administrator (free GUI tool)
- Using mysqladmin
- Using phpMyAdmin
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.
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.
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
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).
Please feel free to use the comments form below if you have any questions or need more explanation on anything. Use the icons below to share this tutorial with your friends.