0

I'm getting mysql errors suggesting that my host's use of strict mode is a problem (with an addon). The host wants mysql strict mode on their DB server. Can I override strict mode for my EE sessions? And if so, how?

I see that codeigniter has a database config setting

$db['default']['stricton'] = FALSE;

but I'm unfamiliar with how to use it. Simply putting

$db['Expressionengine']['stricton'] = FALSE;

into system/expressionengine/config/database.php has no effect. The mode still stays "STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION"

The EE codebase includes a conditional with 'stricton' = TRUE within system/codeigniter/system/database/DB.php But its not clear how to invoke that either (or hack an analogous FALSE conditional)

Any ideas appreciated. Thanks.

1

The stricton setting controls whether or not strict mode is forced on, not whether it is on or off. If the server already has it on (as they should), this will not override it.

You want to run in strict mode, honestly, and it's been the default in MySQL for quite some time. Your efforts would be better spent on bringing the add-on up to date. It should be a fairly trivial thing to do, unless there are hundreds of manually written queries that are assembled in a confusing manner.

| improve this answer | |
  • Ahhh... that makes sense. Thanks. Unfortunately, updating the needed add-on soon is unrealistic for me. It's a combo module-accessory-extension with a fair number of queries and complications. My skills are more as designer than developer. Although it's a commercial add-on, it's been abandoned by the developer. An alternative addon exists but has critical conflicts in my case. For the short term, I will try to work more with the host and see if they can run another MySQL instance in non-strict mode for awhile... – FJLDude Aug 11 '14 at 5:42
  • 1
    If you do happen to try to tackle it, the most common problem is sending an empty string to an autoincrement column. So looking at the tables in phpMyAdmin that belong to this add-on, identify any fields that are autoincrement, and simply remove the field (and the empty value) from any insert statements. – Derek Jones Aug 11 '14 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.