質問

Is there any way to detect whether it's MySQL being used or MariaDB being used? As this would be useful in making MariaDB specific optimizations.

役に立ちましたか?

解決

SHOW VARIABLES LIKE "%version%";

This is from Maria DB

version=10.0.7-MariaDB-1~quantal-log

This is from MySQL

version_comment=MySQL Community Server (GPL)

With PDO you can use ATTR_SERVER_VERSION attribute to get server version:

echo $conn->getAttribute(PDO::ATTR_SERVER_VERSION); // output: <major>.<minor>.<build>-MariaDB
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top