How to Check MySQL Version on Command Line

You can check for your version of MySQL on the command line with the following:

# mysql –version
or
# mysql -V

I tried to search checking mysql version on the command line a couple times without success, so it’s going down here. The smart person would of course just read the mysql man page.

–version, -V
Display version information and exit.

Post written by Ed Reckers

Founder and lead web development consultant at Red Bridge Internet : San Francisco WordPress Developers and Consultants.

3 Responses to “How to Check MySQL Version on Command Line”

  1. Omid

    That’s not entirely correct.

    “mysql -version” or “mysql -V” show the version of the MySQL CLIENT and NOT the SERVER.

    To see the server version, after you have logged in to the MySQL, you can run the following SQL:
    SHOW VARIABLES LIKE “%version%”;

  2. sahil

    mysql> select version(); provides the version of mysql, am I right?

  3. Chetan

    Exactly…
    select version(); provides the version.. It gives like this..

    mysql> select version();
    +———–+
    | version() |
    +———–+
    | 5.5.27 |
    +———–+
    1 row in set (0.00 sec)

Leave a Reply