最近公司一台阿里云上模拟环境突然好好地就出错了额,总提示:"Unknown prepared statement handler (stmt) given to DEALLOCATE PREPARE",原以为是sql语法所致,确定没有问题后,最后确定是因为prepare对应的会话变量为null所知,mysql的max_allowed_packet被篡改为1024了. 之前还一直没想到过max_allowed_packet过小还会导致这异常,不得不说mysql的异常信息真不是一般的不友好
背景: 测试环境1台centOS机器,最近一段频繁报“ Caused by: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1354 > 1024). You can change this value on the server by setting the max_allowed_packet' variable ”, 记录解决问题的思路,最终找到问题根源:黑客入侵,总结经验. 思路: 查看max_a
参考:http://stackoverflow.com/questions/93128/mysql-error-1153-got-a-packet-bigger-than-max-allowed-packet-bytes 用脚本写测试数据,在ubuntu上ok,没想到到centos报1153错误.解决方法: 登入mysql,执行: set global net_buffer_length=1000000; set global max_allowed_packet=1000000000; 就ok
MYSQL Packet for query is too large (12054240 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable. https://www.cnblogs.com/grasshopper/p/7098987.html mysql max_allowed_packet查询和修改 - 水晶糖 - 博客园https://www.cnb