问题1:MySQL Error 1153 - Got a packet bigger than'max_allowed_packet' bytes
解决:1)①通过 show VARIABLES like '%max_allowed_packet%'; 查看初始允许的大小
②修改my.cnf(windows下my.ini),【centos下一般位于/etc/my.cnf/】修改后需重启mysql。在 [mysqld] 下添加 max_allowed_packet=256M (根据实际情况调整数值)
2) mysql>set global max_allowed_packet=524288000;#修改 512M 临时修改的
问题2:mysql5.8出现【Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'Android.tb_autoreport_web.id' which is not functionally dependent on columns in GROUP BY clause;】
解决:1)SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY','')); #临时修改,重新启动mysql服务后会恢复初始设置。
2)修改my.cnf(windows下my.ini),修改后需重启mysql。在 [mysqld] 下添加 sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
3. mysql远程连接,如果服务器在阿里云的,需要考虑阿里云安全策略问题
网友评论