Contents
Why do you need to know your MySQL version?
Knowing which version of MySQL you’re using is crucial because there can be some significant differences between versions. A newer version of MySQL means that your system will have new features and be more capable. Your MySQL version number can be essential in figuring out potential issues when interacting with external tools and plugins since some features might not work with your system.
Outdated databases are vulnerable to security breaches, duplicate data, and inaccurate reporting, among other errors. It’s critical to upgrade your database software to meet your organization’s needs and ensure you’re utilizing the most recent software and technology. Additionally, installing the best MySQL version lowers the possibility of your system failing.
This article will teach you how to check the MySQL version on your server.
Check the MySQL Version
These guidelines are for confirming the MySQL version on our dedicated server and VPS. Remember, some operations need root privileges. And because MariaDB is a fork of MySQL, the commands work interchangeably with each database software.
From the Command Line
Use the following command to check the version of your local MySQL server. This command is not specific to any operating system. This command is compatible with all Linux, Windows, and macOS versions running MySQL.
1 | mysql -V |
Here is the output.
1 | # mysql -V |
Database administration tasks can also be carried out using the client-side utility mysqladmin. It allows you to do many things, including creating and deleting databases, tables, and users and checking the configuration and current status of the server. To find out which version of MySQL is installed, use the mysqladmin command.
1 | mysqladmin -V |
Here is the output.
1 | # mysqladmin -V |
From the MySQL Client
The MySQL command line client is a simple and direct SQL shell that supports input editing. You can use the following command as root to connect to your MySQL client.1 | mysql |
Here is the output.
1 | # mysql |
According to the output, the server is running MariaDB version 10.3.37. There are many commands to get detailed information about the installed version in the MySQL or MariaDB client shell.
SELECT VERSION Statement
Use the _SELECT VERSION()_ command in the MySQL database client to check the MySQL version.1 | SELECT version(); |
Here is the output.
1 | MariaDB [***]> SELECT version(); |
You can also use the following query to check the MySQL version.
1 | SELECT @@version; |
Here is the output.
1 | MariaDB [***]> SELECT @@version; |
STATUS Command
Another option to check the MySQL version is the STATUS command. Run it in the MySQL client tool.
1 | STATUS; |
Here is the output. It contains uptime information, including how long the MySQL server has been running, the threads information, and other valuable details.
1 | MariaDB [***]> STATUS; |
SHOW VARIABLES LIKE Statement
A SHOW VARIABLES LIKE statement is another method of displaying the MySQL version information. Enter the following command in MySQL Client.
1 | SHOW VARIABLES LIKE "%version%"; |
Here is the output.
1 | MariaDB [***]> SHOW VARIABLES LIKE "%version%"; |
OK,If you find this article helpful, feel free to share it with more people.
If you want to find a SQL tool to practice, you can try our sqlynx, which has a simple interface and is easy to use. https://www.sqlynx.com/download/ Free download