c++mysqlwtdbo

Wt Dbo MySQL Backend connection error 'SET storage_engine=INNODB;': Unknown system variable 'storage_engine'


I have been trying to connect with a MySql database using Wt::Dbo::backend::MySQL latest version Wt-3.3.5 but I keep getting the error:

"MySQL error performing query: 'SET storage_engine=INNODB;': Unknown system variable 'storage_engine'"

MySql is running on windows 7, with latest version MySql Server 5.7.10.

I have tried to execute:

SET storage_engine=INNODB;

in the MySql command line and of course get the same Unknown system variable 'storage_engine'". The command that does work is:

SET default_storage_engine=INNODB;

Does this means Wt::Dbo::backend::MySQL does not support this version of MySql? I could not find anything on their documentation nor the internet.

Thanks,


Solution

  • I have found in the following links that indeed the variable "storage_engine" has been renamed to "default_storage_engine", which has caused some software to start getting issues with recent versions of MySql.

    https://dba.stackexchange.com/questions/101908/migrate-jira-to-mysql-unknown-system-variable-storage-engine

    https://confluence.atlassian.com/display/CONFKB/Confluence+fails+to+start+with+error+'Unknown+system+variable+'storage_engine''+using+MySQL+5.7.x

    There are to possible solutions:

    1) Change Wt::Dbo source by modifying the file "MySQL.C" around line 980 in function :

    void MySQL::init()
    {
      executeSql("SET sql_mode='ANSI_QUOTES,REAL_AS_FLOAT'");
      executeSql("SET storage_engine=INNODB;");
      executeSql("SET NAMES 'utf8';");
    }
    

    By first somehow testing first which MySql version the server has and then SET the "default_storage_engine" variable instead "storage_engine". And then recompile the full Wt::Dbo library.

    OR

    2) Go back to the most recent version of MySql in which the variable "storage_engine" has not yet been renamed.

    I opted for solution 2 and uninstalled MySql 5.7 and installed MySql 5.4 and now everything works just fine.

    Hope this helps somebody out there... cheers!