ARZ Host

Recommended Services
Supported Scripts

How to Check Version MySQL in Linux?

How to Check Version MySQL in Linux 1

Overview of MySQL Database Management

How to Check Version MySQL in Linux? The most widely used open-source relational database management system is MySQL (and its direct replacement Maria DB). Knowing which version of MySQL is installed on your server may be crucial in particular circumstances because there are some significant differences between them.

For instance, you must first determine the version of your MySQL server if you are installing an application that needs a specific version of MySQL in order to complete the installation.

This article from our blog will demonstrate How to Check Version MySQL in Linux? or Maria DB server is currently installed on your computer.

Lock in Your Hosting Discount—Act Fast and Save Up to 90%!

Save Big on Quality Hosting at ARZ Host—Unlock Up to 90% Off Today!

Steps to Access MySQL via Command Line: Key Commands

You may find the version of your MySQL by using a number of different commands assuming you have SSH access to the server.

MySQL is the name of the MySQL server binary. Run the program while using the version or -V option to obtain the server version:

  • -version MySQL

The command will exit after printing information about the version of MySQL. The MySQL server used in this example is version 5.7.27:

  • Linux on x86 64 using MySQL version 5.7.27-0ubuntu0.18.04.1 (Ubuntu)

The client utility mysqladmin is used to carry out administrative tasks on the MySQL servers. Additionally, it can be used to check the MySQL version:

  • -V mysqladmin

The results will differ slightly from the preceding commands:

  • mysqladmin Ver 8.42 Distrib 5.7.27, for Linux on x86_64

Related Article: How to Fix MySQL “Command Not Found”

Benefits of Using MySQL Shell for Database Management

The version of the MySQL server can also be found by using a command-line client tool like MySQL.

Type MySQL to connect to the MySQL server:

  • MySQL

The version will be displayed on the screen after you are connected to the MySQL shell:

  1. This is the MySQL monitor, welcome. Commands have a; or g at the end.
  2. It is 3 for your MySQL connection id.
  3. Version 5.7.27-0ubuntu0.18.04.1 of the server (Ubuntu)

Use the version variables to perform a query to obtain details about the MySQL version and other components:

SHOW VARIABLES LIKE “%version%”;

+————————-+————————-+

| Variable name           | Value                   |

+————————-+————————-+

| innodb_version          | 5.7.27                  |

| protocol version        | 10                      |

| slave_type_conversions |                         |

| tls_version             | TLSv1, TLSv1.1           |

| version                 | 5.7.27-0ubuntu0.18.04.1 |

| version comment         | (Ubuntu)             |

| version_compile_machine | x86_64                  |

| version_compile_os      | Linux                   |

+————————-+————————-+

8 rows in set (0.02 sec)

Additional clauses and procedures might also display the server version for you. Only the MySQL version will be shown by the SELECT VERSION () command.

  • SELECT VERSION () in MySQL

The STATUS command displays the version of MySQL as well as details about the server’s status:

  • MYSQL>STATUS

See more about MySQL in our article Easy Guide to MySQL Extension in WordPress.

Using PHP to Interact with MySQL: Executing SQL Queries Through PHP

How to Check Version MySQL in Linux? You may find out the version of the MySQL server using PHP if you are using shared hosting and don’t have access to the command line or a MySQL client like PHPMyAdmin.

Using an FTP or SFTP client, upload the subsequent PHP file to the document root directory of your website. As soon as you switch my user and my password to a real MySQL user account, be sure to:

  • MySQL-version.php
  • <? php
  • // Create a database connection.
  • $link = mysqli_connect ("localhost", "my_user", "my password");
  • // Print the MySQL version.
  • echo mysqli_get_server_info($link);
  • // Close the connection.
  • mysqli_close($link);

Open the file in your browser and the version of the MySQL server will be displayed on your screen:

  • 7.27-0ubuntu0.18.04.1

Get Unlimited Power with VPS Hosting – Best Plans Available

Unlock the Potential of VPS Hosting – Starter Plan starts at just $12.50/month

Conclusion: Final Tips for Effective Database Management

How to Check Version MySQL in Linux? Finding the MySQL server’s version is a fairly simple process. This tutorial has several different methods for determining the version of MySQL that is installed on your machine.

If you have any questions, don’t hesitate to leave a remark. For scalable and reliable hosting, Visit ARZ Host.

Read More:

Table of Content