• Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate
TecNStuff
Menu
  • Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate

How to Check MySQL Version

Written by Admin, Updated On May 22, 2020
mariadb, mysql
How to Check the MySQL Version

MySQL is one of the most popular open-source RDBMS (Relational database management system). MySQL provides some features for particular version numbers and on particular platforms only, so knowing which version is running on your server is really important. In this quick tutorial, we’ll explain how to check the MySQL or MariaDB version on your server.

Using Command Line#

The MySQL server binary is named mysqld. Run the binary using -V or --version to get the server version:

mysqld --version

In output you will see information about the MySQL version and exit.

mysqld Ver 5.7.30-0ubuntu0.18.04.1 for Linux on x86_64 ((Ubuntu))

In this example, MySQL server version is 5.7.30.

You also can use the mysqladmin is a client utility to check the version:

mysqladmin -V
mysqladmin Ver 8.42 Distrib 5.7.30, for Linux on x86_64

You will see some difference in output as compare to previous command.

From the MySQL Shell#

You can use the MySQL Client Tools to find version details. To connect to the MySQL server simply type mysql:

mysql

The version will be display on screen once you connected to MySQL shell:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.30-0ubuntu0.18.04.1 (Ubuntu)

If you would like to get more details about MySQL and it’s components, run command as following:

SHOW VARIABLES LIKE "%version%";
+-------------------------+-------------------------+
| Variable_name           | Value                   |
+-------------------------+-------------------------+
| innodb_version          | 5.7.30                  |
| protocol_version        | 10                      |
| slave_type_conversions  |                         |
| tls_version             | TLSv1,TLSv1.1,TLSv1.2   |
| version                 | 5.7.30-0ubuntu0.18.04.1 |
| version_comment         | (Ubuntu)                |
| version_compile_machine | x86_64                  |
| version_compile_os      | Linux                   |
+-------------------------+-------------------------+
8 rows in set (0.00 sec)

Another way to show the MySQL version details is using STATUS command:

STATUS;

From The PHPMyAdmin Interface#

If you are not familiar with command line through ssh and have access to PhpMyAdmin on server then you can easily check the MySQL version. Once you will logged in on PhpMyAdmin, at right side you will see a box named “Database server”. In this box it will show server version of MySQL as given in following:

mysql-version-linux

Using PHP#

If you don’t have access to command line or PhpMyAdmin interface and running on shared hosting, you can check the version using PHP.

Create a new version.php PHP file and add following lines to it:

<?php

// Create a database connection.
$link = mysqli_connect("localhost", "MYSQL_USERNAME", "MYSQL_PASSWORD");

// Print the MySQL version.
echo mysqli_get_server_info($link);

// Close the connection.
mysqli_close($link);

Now upload this file to your document root directory using a FTP or SFTP client. Make sure you have to change MYSQL_USERNAME and MYSQL_PASSWORD with your real MySQL account details.

Open this file with your web browser and it will display MySQL version on screen.

5.7.30-0ubuntu0.18.04.1

Conclusion#

In this tutorial, you have learned how to check the MySQL version with several different methods.

Feel free to leave a comment if you have any questions.

If our content helps you, please consider buying us a coffee

Thank you for your support.

Share On
Share on Facebook
Share on Twitter
Share on Reddit
Share on Tumblr
 Previous Article How to Create a File in Linux
Next Article   How to Install VirtualBox on Ubuntu 20.04

Related Posts

  • How to Create and Select MySQL Databases

    How to Create and Select MySQL Database

    October 14, 2020
  • How to BackUp and Restore MySQL Database with Mysqldump

    BackUp and Restore MySQL/MariaDB Database

    October 5, 2020
  • How to Install MariaDB on Ubuntu 20.04

    How to Install MariaDB on Ubuntu 20.04

    May 18, 2020

Leave a Reply Cancel reply

Popular Posts

  • How to Install Python 3.9 on Debian 10
    How to Install Python 3.9 on Debian 10 December 25, 2020
  • How to Install Python 3.9 on Ubuntu 20.04
    How to Install Python 3.9 on Ubuntu 20.04 December 21, 2020
  • How to Install GIMP on Ubuntu 20.04
    How to Install GIMP 2.10 on Ubuntu 20.04 December 22, 2020
  • How to Install Notepad++ on Debian 10
    How to Install Notepad++ on Debian 10 December 23, 2020
  • How to Install Php 8 on Debian 10
    How to Install PHP 8 on Debian 10 January 2, 2021
© 2020 TecNStuff All rights reserved. This website is using and storing cookies on your browser. By using this website you agree our Privacy Policy.  Follow us -  Twitter | Facebook