当前位置:网站首页>which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mod

which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mod

2022-06-11 17:14:00 年少~年

编辑
vim /etc/my.cnf
在文件底部加入:

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

重启:systemctl restart mysqld 结果不成功 ,
查看错误原因
cat /var/log/mysqld.log

 /usr/sbin/mysqld: Error while setting value 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' to 'sql_mode'.

在这里插入图片描述
原因:8.0以上已经取消了NO_AUTO_CREATE_USER这个关键字,在mysql.ini中的sql_mode中删掉这个关键字即可。

最终配置

sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

在这里插入图片描述

原网站

版权声明
本文为[年少~年]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_46124208/article/details/124935989