Skip to content

Instantly share code, notes, and snippets.

@jlabs
Last active September 8, 2020 09:52
Show Gist options
  • Save jlabs/7ab1518c8a5557887889edb9b72d6767 to your computer and use it in GitHub Desktop.
Save jlabs/7ab1518c8a5557887889edb9b72d6767 to your computer and use it in GitHub Desktop.
Fix for MySQL 5.7.5+ and Craft 2.x (see https://craftcms.stackexchange.com/a/12106 for info). Add the comment and the line below the commend to 'config/db.php'
<?php
return array(
// Fix for MySQL 5.7.5+ and Craft 2.x
'initSQLs' => array("SET SESSION sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';")
);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment