Feature #68704


Set MySQL sql_mode

Added by Markus Blaschke almost 9 years ago. Updated almost 9 years ago.

Should have
Install Tool
Target version:
Start date:
Due date:
% Done:


Estimated time:
PHP Version:
Sprint Focus:


There should be an $TYPO3_CONF['DB']['sqlMode'] setting for dynamically set the sql mode.

The MySQL/MariaDB/PerconaDB SQL mode can be set per connection/session with:

SET sql_mode='';



Admins/Developers don't need to modify the global sql mode for running TYPO3 :)

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #80035: Strict MySQL sql_mode breaks workspacesClosed2017-02-27

Actions #2

Updated by Wouter Wolters almost 9 years ago

  • Status changed from New to Needs Feedback

This can be done with [SYS][setDBinit] in the Install Tool already. Please try this first.

Actions #3

Updated by Daniel Goerz almost 9 years ago

  • Tracker changed from Bug to Feature
  • Target version set to 7.5

Recategorized on demand of Markus.

Actions #4

Updated by Markus Blaschke almost 9 years ago

I know that it can be done with setDbInit but most devs don't know this MySQL feature.

Maybe TYPO3 should set this value for it's own database connection because most devs are removing this setting from the global MySQL/MariaDB configuration which is not a good idea.
Also TYPO3 could set tighter default values for the next Version (eg. 8) to prevent common sql errors.

With the sql mode you can prevent setting too big values for fields or setting wrong values into ENUM/SET fields. Also wrong GROUP BY usage can be prevented which is an error.

Actions #5

Updated by Morton Jonuschat almost 9 years ago

  • Category set to Install Tool
  • Status changed from Needs Feedback to Closed
  • Assignee set to Morton Jonuschat

After discussing this in #typo3-cms-coredev we decided to close this in favor of a more generic solution. At the moment setting SQLmodes, especially the STRICT_* modes, will result in lots of errors in the core as running MySQL strict mode is not supported.
There is currently a check for the install tool under review that will warn the user about incompatible modes. These can either be fixed on the server (globally) or by using .

In the long run MySQL strict mode will be supported in the core, then the main reason to remove the SQLmode setting from the DB configuration should be null and void. For the few remaining edge cases DBinit should be good enough. There have already been some discussions about modifying the SQLmode in the past and the outcome has always been that it undesirable for TYPO3 to modify these setting on it's own.


Also available in: Atom PDF