Find out if you’re running MariaDB, MySQL or Percona Server

MariaDB and MySQL are mostly compatible, while Percona Server is basically MySQL with some optimisations. For this reason, it’s quite common for developers not being sure which of them they are using.

Finding out if you’re running MariaDB, MySQL or Percona Server is easy.

MariaDB contains the word 'MariaDB' in the version variable:

SELECT @@version LIKE '%MariaDB%';

In Percona Server version_comment should contain the 'Percona' string. However, some versions of Percona Server allow to change version_comment dynamically, to trick software that require a MySQL commercial edition. So, if the string ‘Percona’ is not there, you should still try to modify version_comment, and if you don’t get an error, you’re running Percona Server.

SELECT @@version_comment LIKE '%Percona%';
SET GLOBAL version_comment = @@version_comment;

If none of the above queries show that you’re using anything different than MySQL, you’re using MySQL.

Reference

Related articles:

About version_comment in Percona Server: