工作中遇到的异常

1、Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #15 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'supplycfdb.tu.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible wit
h sql_mode=only_full_group_by; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #15 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'supplycfdb.tu.id' which is not functionally dependent on columns in GROUP BY c
lause; this is incompatible with sql_mode=only_full_group_by!
解决方案: 是因为5.7版本默认sql_mode=only_full_group_by  在my.ini直接开启最后一行,就去掉only_full_group_by 没有的话加一个sql_mode='';




2、The last packet successfully received from the server was 42,827 milliseconds ago.  The last packet sent successfully to the server was 0 milliseconds ago.; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
错误原因:MySQL服务在长时间不连接之后断开了,断开之后的首次请求会抛出这个异常
解决方案: 1、既然是长时间不连接之后断开了,那这个时间应该是可以设定的,或者现在mysql用的还是默认的值  2、如何查看现在的时间值,以及如何修改我的mysql是安装在windows系统上,就以这个说明,若是在开发中mysql安装在linux上,操作步骤几乎一样
修改timeout 默认修改为8小时
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值