版权声明:欢迎评论,指点,交流! https://blog.csdn.net/qq_15230053/article/details/81978444
There are three ways to enlarge the max_allowed_packet of mysql server:
- Change
max_allowed_packet=64M
in file/etc/mysql/my.cnf
on the mysql server machine and restart the server - Execute the sql on the mysql server:
set global max_allowed_packet=67108864;
- Python executes sql after connecting to the mysql:
只要执行:set global max_allowed_packet=67108864;就可以了!