Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

determine if mysql or percona or mariaDB

How can i tell if a server I'm connecting to is Percona or MySQL or MariaDB? Is there any standard way of doing this? I'm currently using SHOW VERSION to test the server version, but I would also need to display the server name in the app I'm working on.

like image 715
Quamis Avatar asked May 19 '16 08:05

Quamis


People also ask

How do I know if I have MariaDB or MySQL?

Use phpMyAdmin to find the MySQL database server version. Simply, login to your phpMyAdmin, and on the left side of Dashboard, you will get all key details including the version of MySQL or MariaDB.

How do I know if I have percona MySQL?

If you see anything XTRADB such as XTRADB_READ_VIEW/XTRADB_INTERNAL_HASH_TABLES/XTRADB_RSEG then you know it is Percona Server since they add in XTRADB.

Is percona a MariaDB?

Percona is the premier support provider for open source databases, including MariaDB, the most well-known fork of MySQL.


1 Answers

Keep in mind that "MySQL" is the original, and the others are spinoffs. Here is some code that probably always works:

version_comment REGEXP 'MariaDB' -- > Mariadb
version_comment REGEXP 'Percona' -- > Percona
else MySQL

version_comment can be accessed via SHOW VARIABLES or information_schema.

@@version is not reliable because Percona leaves no clue, although I suspect the '-30.3-' is a clue in 5.5.31-30.3-log.

(I checked 106 servers.)

Update

(checking 264 servers.)

version         REGEXP 'MariaDB' -- > Mariadb
version_comment REGEXP 'Percona' -- > Percona
else MySQL

(And we probably cannot trust for this to be the final word.)

like image 184
Rick James Avatar answered Oct 25 '22 03:10

Rick James