MySQL is the most popular open-source database around the world. It gives the incredible level of satisfaction in terms of performance, reliability, and ease of use. It is important to know which version of MySQL you’re using because when you know the version, you can quickly figure out what type of configuration changes and other settings you need to maintain.

In this post, you will learn how you can check your MySQL version. But before we move to the procedures that how to check its version I would like to highlight that MySQL is a fundamental ingredient of every web-based application. From a simple blog to huge organizational portals everything is under the database. Therefore, it should be up to date.

What is MySQL?

MySQL is a database management system developed by Oracle Corporation and mostly used for web servers. It can be deployed on any operating system such as Linux, Windows, and Unix. currently, MySQL is RDBMS (Relational Database Management System) behind many leading brands in the world like Facebook, Twitter etc.

It is an indispensable factor of open source stack called as the LAMP, used to create websites. A LAMP and XAMPP are web development platforms that comprises Linux as an operating system, Apache as a web server, MySQL as a database system, and PHP as a scripting language.

Use of MySQL

The most widely used web application WordPress also require a database to store and retrieve all the data such as user profile, content, post types etc. However, PHP works as an intermediate to move data from MySQL to WordPress. In order to retrieve data from the database, WordPress runs SQL (Structured Query Language) queries to generate content dynamically.

Therefore, it is highly recommended that the version of the database being used should be compatible with PHP being used in the web application. Here we discussed some database connection errors. So, let’s now delve into the measures by which you can check the rendition of your database system. First, we will examine it for Linux.

Check MySQL Version On Linux

There are more than one methods and we will be discussing all of them one by one.

Method 1:

If in order to manage your database, you have had installed PHPMyAdmin Script, then you can easily access the details through the PHPMyAdmin tool.

phpmyadmin linux

Method 2:

Following commands are for Linux to check the version. You can visit stackoverflow for more details

mysql --version

Then you will see the output somewhat similar to this;

Method 3:

Configuration and Runtime variable.

mysqladmin -V

By using this command you will see the current version, runtime variables, and configuration.

Check MySQL Version On Your Web Server

The below-given approach will help you detect the version on your web server.

Method 4:

You can check the MySQL rendition via a PHP script. You need to create a new file in your account let’s say you have created a file with the name test.php and inside the file paste the following code.

<?php

$mysqli = new mysqli("localhost", "username", "password");

/* check connection */

if (mysqli_connect_errno()) {

printf("Connect failed: %s\n", mysqli_connect_error());

exit();

}

/* print server version */

printf("Server version: %s\n", $mysqli->server_info);

/* close connection */

$mysqli->close();

?>

Here, at the place of username add your cPanel username and at the place of password type your cPanel password. Now, on opening the file in the browser, you will see the latest version up and running on your server.

Conclusion

Now you are familiar with the methods. As per your requirements, choose any of the methods to check the MySQL version and get going. If you still feel that something is not clear to you, please feel free to share your thoughts in the comments below. And I will make every possible effort to make things clear for you. And do tell me if this post is any help to you.