Updated: 4 November 2026 · Applies to: MySQL 8.4 (8.4.11) and MariaDB 11.8 (11.8.6 on Debian 13, 11.8.9 official image), phpMyAdmin 5.2, cPanel

The quickest MySQL version query is SELECT VERSION();. Run it in any MySQL or MariaDB client, phpMyAdmin’s SQL tab or your application, and it returns the version of the server you are connected to. From a Linux shell, mysql -u root -p -e "SELECT VERSION();" does the same in one line. mysql --version only shows the version of the client program, which can differ from the server.

1. Query the version with SQL

  1. Log in to the server: mysql -u root -p (on MariaDB the client is called mariadb; see How to Connect to a MySQL Database from the Command Line (Local and Remote) for remote logins).
  2. Run the query:
    mysql> SELECT VERSION();
    +-----------+
    | VERSION() |
    +-----------+
    | 8.4.11    |
    +-----------+
  3. On MariaDB the same query shows the product name and package build:
    MariaDB [(none)]> SELECT VERSION();
    +------------------------+
    | VERSION()              |
    +------------------------+
    | 11.8.9-MariaDB-ubu2404 |
    +------------------------+

No special privilege is needed. In our test a new user with only GRANT USAGE ON *.* (no database rights at all) still got the answer, so this works with a shared hosting database user too.

2. Get more detail: SHOW VARIABLES and @@version

The version is also a server variable. SHOW VARIABLES LIKE 'version%'; adds the edition, platform and build details:

mysql> SHOW VARIABLES LIKE 'version%';
+-------------------------+------------------------------+
| Variable_name           | Value                        |
+-------------------------+------------------------------+
| version                 | 8.4.11                       |
| version_comment         | MySQL Community Server - GPL |
| version_compile_machine | x86_64                       |
| version_compile_os      | Linux                        |
| version_compile_zlib    | 1.3.2                        |
+-------------------------+------------------------------+

On MariaDB 11.8 the list also includes version_ssl_library (for example OpenSSL 3.0.13 30 Jan 2024) and version_source_revision. To pick single values, select the variables directly:

SELECT @@version, @@version_comment;

version_comment tells you which product you really have: MySQL Community Server - GPL for Oracle MySQL, mariadb.org binary distribution or a distribution name for MariaDB.

3. Check the version from the Linux command line

  • One-line query (asks for the password): mysql -u root -p -e "SELECT VERSION();"
  • For scripts, add -sN to drop the table border and header, so only the number is printed:
    $ mysql -u root -p -sN -e "SELECT VERSION();"
    8.4.11
  • mysqladmin (mariadb-admin on MariaDB) prints the server version with uptime and socket:
    $ mysqladmin -u root -p version
    (copyright lines removed)
    Server version		8.4.11
    Protocol version	10
    Connection		Localhost via UNIX socket
    UNIX socket		/var/run/mysqld/mysqld.sock
  • Inside the client, type status (or \s). It shows both the client line and Server version: 8.4.11 MySQL Community Server - GPL. The welcome banner you see right after logging in shows the same Server version: line.
  • A remote server: mysql -h db.example.com -u appuser -p -e "SELECT VERSION();". The answer comes from the remote server, whatever client version you run locally.

4. Client and server binaries: mysql --version and mysqld --version

These read the version of the program file and need no login:

$ mysql --version
mysql  Ver 8.4.11 for Linux on x86_64 (MySQL Community Server - GPL)
$ mysqld --version
/usr/sbin/mysqld  Ver 8.4.11 for Linux on x86_64 (MySQL Community Server - GPL)

On MariaDB use mariadb --version and mariadbd --version:

$ mariadb --version
mariadb from 11.8.9-MariaDB, client 15.2 for debian-linux-gnu (x86_64) using  EditLine wrapper

Two things to know:

  • mysql --version is the client. If the client comes from another package or another machine, it says nothing about the server. Use SELECT VERSION(); when the server version matters.
  • The official MariaDB 11.8 container image has no mysql or mysqld commands at all (only the mariadb names), while Debian 13 still installs /usr/bin/mysql as a link to mariadb. If you get “mysql: command not found”, try mariadb --version.

5. Check the version in phpMyAdmin or cPanel

  • phpMyAdmin: on the home page you see right after logging in, the Database server panel lists Server type (MySQL or MariaDB) and Server version.
  • cPanel: according to cPanel, the Server Information interface (search for it in cPanel) shows a MySQL Version row with the server’s MySQL or MariaDB version. Your host can hide this interface in Feature Manager; phpMyAdmin or SELECT VERSION(); still work.
  • phpinfo() is not reliable for this: according to cPanel, the MySQL version it shows is the client library built into PHP, not your database server.

Which versions you will usually find

  • Debian 13: MariaDB 11.8 (11.8.6 in the Debian repository when tested).
  • Ubuntu 26.04 LTS: MySQL 8.4; Ubuntu 24.04 LTS: MySQL 8.0 (see How to Install MySQL on Ubuntu 26.04 and 24.04).
  • cPanel servers: according to cPanel, a new installation gets MariaDB 10.11 unless you choose otherwise; current releases offer MySQL 8.0 and 8.4 and MariaDB up to 11.8 depending on the OS. In WHM 120 and later the version is changed in Database Services > Upgrade Database Version.

Related: How to Run MySQL/MariaDB Queries Directly from the Linux Command Line? shows how to run other queries straight from the shell, and How to Find Out What Version of Linux You Are Running? how to check the Linux version of the same server. On a Ucartz VPS or dedicated server, a quick check like this is covered by Free Basic Managed Support (best effort); a planned database upgrade is a good job for Hire an Expert.

Official documentation: MySQL 8.4 information functions (VERSION), MariaDB VERSION, cPanel supported MySQL and MariaDB versions.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Managed cPanel VPS

cPanel included; we handle updates, security and monitoring.

Server management

on-demand administration, hardening, migrations and monitoring.

Was this answer helpful?

Still stuck? Open a ticket