Disable ONLY_FULL_GROUP_BY

后端 未结 27 1809
既然无缘
既然无缘 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条回答
  •  Happy的楠姐
    2020-11-22 00:58

    The MySQL documentation also specifies the following methods:

    • Set sql-mode="" in an option file such as my.cnf (Unix operating systems) or my.ini (Windows).
    • To set the SQL mode at server startup via the command line, use the --sql-mode="" option.

    *Where is a list of different modes separated by commas.

    To clear the SQL mode explicitly, set it to an empty string using --sql-mode="" on the command line, or sql-mode="" in an option file.

    I added the sql-mode="" option to /etc/my.cnf and it worked.

    This SO solution discusses ways to find out which my.cnf file is being used by MySQL.

    Don't forget to restart MySQL after making changes.

提交回复
热议问题