mysql常见报错
一 ,远程连接报错1130
搭建好的mysql使用本地打开没有问题,当使用远程工具连接是报错
错误代码:1130 host is not allowed to connect to this mysql server
解决办法
使用mysql数据库
更改数据
FLUSH PRIVILEGES; 如果报错:ERROR 1062 (23000): Duplicate entry ‘%-root’ for key ‘PRIMARY’
可以修改具体列中的设置为utf8
或者
show variables like ‘character%’;
将server database改为utf8
1055 - Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column ’test_1.a.score’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
本以为是代码写错了,就没有理会,后来百度了一下才了解到sql标准中不允许select列表,having条件语句,或order by语句中出现group by 中未列表的可聚合列,ONLY_FULL_GROUP_BY 默认为开启
SELECT @@sql_mode; 可以查看
建议使用如下方法解决
SET SESSION sql_mode=(SELECT REPLACE(@@sql_mode,‘ONLY_FULL_GROUP_BY,’,’’));
- 原文作者:徐同学的博客
- 原文链接:https://blogs.xwnlearn.cn/post/2020/mysql%E5%B8%B8%E8%A7%81%E6%8A%A5%E9%94%99/
- 版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议. 进行许可,非商业转载请注明出处(作者,原文链接),商业转载请联系作者获得授权。