How to get MySQL to exit TRADITIONAL mode?

I have an old application that started after upgrading from MySQL 5.0 to 5.1.

Few studies have shown that this is due to "strict mode", which prevents the insertion of certain types of "invalid" values ​​that previously were simply automatically converted to something reasonable.

I tried SET @@SESSION.sql_mode = ''and SET @@GLOBAL.sql_mode = ''but I still get the error.

Also tried to comment sql_modeon my.ini.

Is there a stronger, “nuclear” opportunity to fix this?

+3
source share
2 answers

In my application, I'm usually sure that the MySQL connection uses the traditional mode, releasing

SET SESSION sql_mode = 'ANSI_QUOTES,TRADITIONAL'

. ,

SET SESSION sql_mode = ''

, .

SQL ,

SET GLOBAL sql_mode = ''

.

, , , SQL , , .

+5

, :

SET sql_mode = 'ALLOW_INVALID_DATES';

.

0

Source: https://habr.com/ru/post/1777603/


All Articles