Web/database development and more...
« About Apple DesignEasy web snapshots »

How to check what MySQL version I am using?

10/01/07

How to check what MySQL version I am using?

  04:44:00 pm, by fplanque   , Categories: mySQL

In order to determine which MySQL version you're running you can type the following command: mysql -V

Sample results:

# mysql -V
mysql Ver 14.7 Distrib 4.1.11, for pc-linux-gnu (i386)

# mysql -V
mysql Ver 14.12 Distrib 5.0.32, for pc-linux-gnu (i486) using readline 5.2

Now, if you want to query for the version number while beign logged in (PHP script for example), just go with: SELECT VERSION(); .

I believe this is only working since MySQL 4 though.

Tags: howto, mysql

3 comments

Comment from: Andrew [Visitor]  
Andrew

Hi,

For all versions of mysql if you do SHOW VARIABLES; you will see the version in the list returned regardless of the version of mysql used.

10/11/07 @ 10:37
Comment from: ryan [Visitor]
ryan

SELECT VERSION(); will work on mysql 3.23

05/11/10 @ 00:20
Comment from: shahryar ghazi [Visitor]
shahryar ghazi

here is a complete tutorial http://www.geeksww.com/tutorials/database_management_systems/mysql/tips_and_tricks/how_to_check_mysql_version_number.php

i guess u r only printing the client’s version no. thru mysql -v

11/02/10 @ 14:43