mySQL / MariaDB - Determine the version of mySQL or MariaDB on Linux

by
Jeremy Canfield |
Updated: January 07 2022
| mySQL / MariaDB articles
Assuming you have mySQL or MariaDB installed on a Linux system, the which command can be used to determine if the mysql command line tool is installed. In this example, the mysql command line tool is installed.
~]# which mysql
/bin/mysql
The mysql command with the -V or --version flag can be used to determine the version of mySQL or MariaDB that is installed.
~]# mysql --version
mysql Ver 14.14 Distrib 5.7.33, for Linux (x86_64) using EditLine wrapper
Or like this.
~]# mysql -e "select @@version"
+-----------------+
| @@version |
+-----------------+
| 10.5.10-MariaDB |
+-----------------+
Did you find this article helpful?
If so, consider buying me a coffee over at