Got a “max_allowed_packet” error during mysqldump. This happened after I added a longblob to one of my tables. Below is the error:
mysqldump --routines --user=root -p localDB > backup.mysql.txt mysqldump: Error 2020: Got packet bigger than 'max_allowed_packet' bytes when dumping table `table2` at row: 86
It turns out max_allowed_packet is set to something less than whatever is in my row 86. Longblob can go up to 4Gb so I will need to override the max_allowed_packet value.
I found the following way the easiest to re-enable the dump.
mysqldump --routines --max_allowed_packet=100M --user=root -p localDB > backup.mysql.txt
Backup e Restauração de banco de dados MySQL via SSH: http://naninho.blog.br/web/mysql/backup-restauracao-banco-de-dados-mysql-ssh.html
LikeLike