Hi Ian,
Many thanks for your investigation! Thanks to it, I was able to reproduce your issue on my computer. For further reference, here are the instructions:
(1) Start the MySQL container in one terminal:
$ docker run --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root --rm -t -i mysql:8.0.19
(2) Create a database for Orthanc within this MySQL container (in another terminal):
$ cat <<EOF | mysql --protocol=tcp --host=localhost --port=3306 --user=root -p
CREATE USER ‘orthanc’@‘%’ IDENTIFIED BY ‘orthanc’;
GRANT ALL PRIVILEGES ON orthanc.* TO ‘orthanc’@‘%’;
CREATE DATABASE orthanc;
EOF
NB: Password is “root”, cf. the “MYSQL_ROOT_PASSWORD” environment variable.
(3) Start Orthanc using the following configuration file:
{
“Name” : “MyOrthanc”,
“MySQL” : {
“EnableIndex” : true,
“EnableStorage” : true,
“Host” : “localhost”,
“Port” : 3306,
“UnixSocket” : “”,
“Database” : “orthanc”,
“Username” : “orthanc”,
“Password” : “orthanc”,
“Lock” : true
},
“Plugins” : [ “.” ]
}
In such a situation, MySQL plugin 2.0 stops and reports the following error (which indicates that the Orthanc database has not fully been initialized):
E0312 12:22:15.924770 PluginsManager.cpp:164] MySQL error (1419,HY000): You do not have the SUPER privilege and binary logging is enabled (you might want to use the less safe log_bin_trust_function_creators variable)
If Orthanc is then started a second time, we get your initial error message:
E0312 12:22:30.514954 PluginsManager.cpp:164] MySQL plugin is incompatible with database schema version: 0
The error results from the fact that, by default, a regular MySQL user has not the possibility to run the “CREATE TRIGGER” command. This corrupts the initialization process.
I have just pushed a fix in the mainline of the MySQL plugin, that adds safeguards to avoid this corruption and that displays a solution for the Orthanc user:
https://bitbucket.org/sjodogne/orthanc-databases/commits/740d9829f52e59719eb5770f56a537e820f61ec0
I would love to have your feedback about this modification. If this patch fixes your issue, I’ll happily make a fresh release 2.1 of the MySQL plugin.
Regards,
Sébastien-