创建数据库并解决报错this is incompatible with sql_mode=only_full_group_by
来源:互联网 发布:国外网络电视台直播 编辑:程序博客网 时间:2024/06/05 20:40
安装完mysql服务器之后,用数据库管理软件(我这里使用的是navicat)新建连接并连接到本地数据库。
新建查询,并输入创建数据库语句:create database study;
选中并运行,得到以下结果:
可以看到,虽然创建数据库成功了,但是报了个错。这个错误是因为对于当前版本的mysql服务器来说,GROUP BY聚合操作,如果在SELECT中的列,没有在GROUP BY中出现,那么这个SQL是不合法的,因为列不在GROUP BY从句中,也就是说查出来的列必须在group by后面出现否则就会报错,或者这个字段出现在聚合函数里面。
在网上查了一下,得到一个解决方案,修改my.ini
SET sql_mode ='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
然后重启mysql服务器,结果报错了:
查看一下mysql server的错误日志,发现果然报错了:
2017-12-11T09:51:15.078598Z 0 [ERROR] unknown variable 'SET sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
2017-12-11T09:51:15.080598Z 0 [ERROR] Aborting
改成sql_mode ='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
然后再重启,这次顺利启动了
重新运行create 语句,发现ONLY_FULL_GROUP_BY的错误消失了。
- 创建数据库并解决报错this is incompatible with sql_mode=only_full_group_by
- mysql5.7.9报错this is incompatible with sql_mode=only_full_group_by之解决
- this is incompatible with sql_mode=only_full_group_by
- this is incompatible with sql_mode=only_full_group_by
- this is incompatible with sql_mode=only_full_group_by
- mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by
- mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by
- mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by
- mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by
- mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by
- mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by
- mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by
- mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by
- mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by
- mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by
- 解决MySQL 5.7.9版本sql_mode=only_full_group_by问题,this is incompatible with sql_mode=only_full_group_by错误
- MySQL Error this is incompatible with sql_mode=only_full_group_by
- mysql 5.7 this is incompatible with sql_mode=only_full_group_by 问题
- mysql分布式数据库中间件对比
- GDI+学习及代码总结之------画线、区域填充、写字
- 清晰理解 Android Service
- bootstraptable表头居中
- 如何成为一名成功的程序员
- 创建数据库并解决报错this is incompatible with sql_mode=only_full_group_by
- 关于数据库id的重新排序自增
- Retrofit结合Rxjava初步使用
- POI事件模式读取Excel 2007(三)
- php字符函数大全
- 通俗地解释脏读、不可重复读、幻读
- 安卓中margin、algin、padding区别(图解)
- 时间复杂度详解
- MVC模式(一)