Disable ONLY_FULL_GROUP_BY

后端 未结 27 1378
既然无缘
既然无缘 2020-11-22 00:22

I accidentally enabled ONLY_FULL_GROUP_BY mode like this:

SET sql_mode = \'ONLY_FULL_GROUP_BY\';

How do I disable it?

27条回答
  •  旧时难觅i
    2020-11-22 01:13

    On my sql (version 5.7.11 running on Mac OS X) this work for me on mysql shell client:

    SET
    @@GLOBAL.sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
    

    According to MySQL 5.6 Documentation, sql_mode is default is

    blank string in MySQL 5.6.5 and back NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES in 5.6.6 +

    mysql 5.6 reference

提交回复
热议问题