mysql 5.7版本 出现 ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql> set global sql_mode='NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES'' at line 1 解决方案

在  mysql 5.7版本 出现 ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘mysql> set global sql_mode=’NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES” at line 1 

我是因为 执行 了 group by 语句 出错的

select * from recordTable group by user_number;

在 mysql  中 查看:

mysql> select @@session.sql_mode;

出现:

《mysql 5.7版本 出现 ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql> set global sql_mode=’NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES” at line 1 解决方案》” /></p><p>这个时候 你需要把 ONLY_FULL_GROUP_BY 去掉</p><p>找到 my.cnf 配置文件</p><blockquote><p>vim   /etc/my.cnf</p></blockquote><p>在 mysqld 模块 最后面 输入</p><blockquote><p>sql_mode=STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION</p></blockquote><p>如:</p><p><img layer-src=     原文作者:JoeWcc
    原文地址: https://www.jianshu.com/p/4fb15cc8e8ef
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。

点赞