mysqldump error: Got packet bigger than max_allowed_packet'

前端 未结 4 1451
遥遥无期
遥遥无期 2021-02-01 12:21

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 c

相关标签:
4条回答
  • 2021-02-01 12:47

    Some of my scripts stopped working after an upgrade to Debian 9 & MariaDB.

    MariaDB on Debian introduces a new config file specifically for mysqldump settings (/etc/mysql/conf.d/mysqldump.cnf). If you had set a max_allowed_packet <> 16M in your standard /etc/mysql/my.cnf previously, the new config file will overwrite that setting. So be sure to check this new config file and either delete the entry or adjust it to your needs.

    I'm not sure if the change was introduced by the swap from MySQL to MariaDB or if Debian made a change in how the config files are laid out in V9.

    0 讨论(0)
  • 2021-02-01 13:04

    I had a similar error and would fail with packet size 512M on row 0. It was an innodb table that was apparently damaged (mysqlcheck showed OK). I ended up re-creating the table and then it worked fine with a small packet size of just 128M.

    0 讨论(0)
  • 2021-02-01 13:08

    Set the max allowed packet size using MySql Workbench and restart the server

    0 讨论(0)
  • 2021-02-01 13:09
    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)

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

    0 讨论(0)
提交回复
热议问题