MySQL使用mysqldump导出数据报错

mysql mysqldump: Error 2020: Got packet bigger than 'max_allowed_packet' bytes when dumping table

解决方法:

在导出时加上--max_allowed_packet参数

[root@db-backup data]# mysqldump -urepl -p -h 10.11.10.243 -P 3306 --max_allowed_packet=512M -q \ 
--single-transaction --master-data=2 --databases xxx > /data/20180810_xxx.sql

[root@db-backup data]# mysqldump --help|grep max
postgresql, oracle, mssql, db2, maxdb, no_key_options,
--max-allowed-packet=#
The maximum packet length to send to or receive from

max-allowed-packet       25165824




原文连接:http://blog.itpub.net/26506993/viewspace-2199827/

欢迎留言