How to Check the MySQL Version

In this quick tutorial we’ll learn how to check the MySQL version of a server. Without a doubt MySQL is one of the most popular RDBMS options available, so you’ll find it pretty much everywhere. There can be some pretty staggering differences between MySQL versions, so knowing which version you’re working with is important. Learn here how, to check the version of MySQL your server is using!

Check the MySQL version

Pre-Flight Check
  • These instructions are intended for checking the MySQL (or MariaDB) version on your server.
  • I’ll be working from a Liquid Web Core Managed CentOS 7 server, and I’ll be logged in as root.

From the Command Line

  1. With a command line open, enter the following command:
    mysql -V

    mysql  Ver 15.1 Distrib 10.1.29-MariaDB, for Linux (x86_64) using readline 5.1
Note: Are you looking to upgrade MySQL on a Liquid Web Core Managed or Fully Managed server? Then contact our Heroic Support® team. If you’re looking for ways to improve the performance of your VPS, check out our blog on Optimizing Your VPS!

Here's 75% off a New VPS! Find out why 30,000 customers have chosen our Best-in-Class Performance & 24x7 Heroic Support

From the MySQL Client

  1. When you run the MySQL command client without any flags the version will be displayed. So while logged in via SSH enter:
    mysql

    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 4
    Server version: 10.1.29-MariaDB MariaDB Server
    
    Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    The server version in this example is 10.1.29-MariaDB MariaDB Server.

  2. From within the MySQL client you can also run the following command for more details:
    SHOW VARIABLES LIKE "%version%";

    +-------------------------+----------------------------+
    | Variable_name           | Value                      |
    +-------------------------+----------------------------+
    | innodb_version          | 5.6.36-82.2                |
    | protocol_version        | 10                         |
    | slave_type_conversions  |                            |
    | version                 | 10.1.29-MariaDB            |
    | version_comment         | MariaDB Server             |
    | version_compile_machine | x86_64                     |
    | version_compile_os      | Linux                      |
    | version_malloc_library  | system                     |
    | version_ssl_library     | OpenSSL 1.1.0g  2 Nov 2017 |
    | wsrep_patch_version     | wsrep_25.21                |
    +-------------------------+----------------------------+
    10 rows in set (0.02 sec)
    

In this block of text you’ll find additional version details about your installed MySQL software like: innodb_versionprotocol_versionversion_ssl_library, and more.

Looking for other MySQL tutorials? We have two awesome series! First, Basic Database Interaction. Second, Basic User Interaction. Check them out below!

 

 

Be Sociable, Share!
Here's 75 % off, Launch a New VPS Today. Find out why 30,000 customers have chosen our Best-in-Class Performance & 24x7 Heroic Support