How do you know which versions of MySQL or MariaDB database server you’re running? How do you find out? What command do you use? The answer to all your questions is detailed below. Nowadays, everywhere you look you’ll find MariaDB database servers being used with many open-source projects. This was not the case a few years ago. Then, MySQL was probably the only database server used in the majority of the open-source projects. However, licensing changes made by Oracle, the new parent company established an alternative to MySQL called MariaDB. To get started with checking MySQL or MariaDB database versions, follow the steps below:

Check the MySQL Server version

MySQL and MariaDB come with a built-in tool that allows you to check the server versions. Simply run the commands below with the -d argument to display the current version of the server. Running the command above will show which version the server is running. If you run the commands below, it should also display the server version Output from the command above. MySQL and MariaDB come with a client tool that also should help you find the server version. From the command line, invoke the client tool by running the command below: That will allow you to log in and display the server details including the version number. MariaDB server will output the message below: Or run the STATUS query to display the server details including the version number. That should display the output below: These methods are a few that help you determine the server version of MySQL or MariaDB from the command line console.

Using phpMyAdmin

If you have phpMyAdmin installed, you should also be able to see the server version from the portal. Login and view the server detail from the dashboard.

Using PHP

If you can upload a file to your web root directory, simply create a local file called mysqlversion.php. Then copy and paste the code below into the file and upload it to your server root folder. Then browse to the server hostname or IP address followed by mysqlversion.php That will display your server version. There might be other ways to view your database server version number in Ubuntu Linux. However, the few methods above should get you started. Conclusion: This post showed you how to find the version number of MySQL or MariaDB database server in Ubuntu Linux. If you find any error above, please use the comment form below to report.