Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Check MySQL Version - DesignLinux

May 29 2020
designlinux 0 Comments
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.

Related

Tags: mariadb, mysql

How to Install VirtualBox on Ubuntu 20.04

Prev Post

24 Free Open Source Applications I Found in Year 2019

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 4
  • 780
  • 615,152

DesignLinux.com © All rights reserved

Go to mobile version