mysqldump错误:数据包大于max_allowed_pa​​cket' [英] mysqldump error: Got packet bigger than max_allowed_packet'

查看:120
本文介绍了mysqldump错误:数据包大于max_allowed_pa​​cket'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序通过IMAP下载邮件并将其存储在MySQL数据库中.早些时候,我支持的邮件大小最大为10 MB,因此用于存储邮件内容的"mediumtext"列就足够了.现在,我需要支持最大30MB的邮件.所以我将列的数据类型更改为"largetext".昨天存储了大小为25 MB的邮件.之后,每当我执行mysqldump命令时,它都会引发错误:

My application download mails over IMAP and stores them in a MySQL database. Earlier I was supporting mails size upto 10 MB and hence a 'mediumtext' column to store the mail content was enough. Now I need to support mails upto 30MB. So I changed the datatype for the column to 'largetext'. Yesterday a mail with size 25 MB was stored. After that whenever I execute mysqldump command it throws error:


mysqldump: Error 2020: Got packet bigger than 'max_allowed_packet' bytes when dumping table `ib_mailbox_backup` at row: 3369

第3369行包含25 MB的邮件.

Row 3369 contains the 25 MB mail.

在MySQL配置中,我将"max_allowed_pa​​cket"从64M增加到512M,但仍然失败,并出现相同的错误.在运行MySQL服务器的同一台机器上执行mysqldump命令.我该如何解决?

In MySQL config I increased the 'max_allowed_packet' from 64M to 512M and it still fails with the same error. Executing the mysqldump command on the same machine where MySQL server is running. How do I solve this?

推荐答案

  1. 您可以在mysqldump命令中添加--max_allowed_packet=512M.
  2. 或将max_allowed_packet=512M添加到my.cnf[mysqldump]部分(感谢@Varun)
  1. You can add --max_allowed_packet=512M to your mysqldump command.
  2. Or add max_allowed_packet=512M to [mysqldump] section of your my.cnf (thanks @Varun)

注意:如果它不在[mysqldump]部分下,则将不起作用...

Note: it will not work if it is not under the [mysqldump] section...

这篇关于mysqldump错误:数据包大于max_allowed_pa​​cket'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆