Turn off the only_full_group_by enabled by default in mysql5.7

1 Check whether the only_full_group_by mode is enabled in mysql. If there is only_full_group_by, it means it is enabled:

select @@sql_mode;


2. Shut down with the command (it will fail after the database is restarted):

SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

3. Modify the my.ini configuration file of mysql (requires restart):

sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

 

 

おすすめ

転載: blog.csdn.net/qq_33551131/article/details/104037954