determine if mysql or percona or mariaDB

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.)


You can get specific information with:

SHOW VARIABLES LIKE '%vers%'

version and version_comment are very specific.