Skip to content

fix: packet for query is too large error in restore#503

Open
akkuman wants to merge 1 commit intodatabacker:masterfrom
akkuman:fix/restore-support-mpt
Open

fix: packet for query is too large error in restore#503
akkuman wants to merge 1 commit intodatabacker:masterfrom
akkuman:fix/restore-support-mpt

Conversation

@akkuman
Copy link
Contributor

@akkuman akkuman commented Feb 26, 2026

environment:

root@9db45bba0a23:/# mariadb -uroot -p"${MARIADB_ROOT_PASSWORD}" --execute "SHOW VARIABLES LIKE 'max_allowed_packet';"
+--------------------+------------+
| Variable_name      | Value      |
+--------------------+------------+
| max_allowed_packet | 1073741824 |
+--------------------+------------+
mariadb --max-allowed-packet=1G -uroot -p"${MARIADB_ROOT_PASSWORD}" < data_2026-02-26T10\:19\:47+08\:00.sql

successful

but

./mysql-backup restore --server 127.0.0.1 --port 3307 --user root --pass 'password' --target "$(pwd)" db_backup.tgz
INFO[0000] beginning restore                             run=2e25518b-1aef-4aa8-846d-115ee757194d
Error: error restoring: failed to restore database: failed to restore database: packet for query is too large. Try adjusting the `Config.MaxAllowedPacket`
FATA[0388] error restoring: failed to restore database: failed to restore database: packet for query is too large. Try adjusting the `Config.MaxAllowedPacket`

after change

./mysql-backup restore --max-allowed-packet 1073741824 --server 127.0.0.1 --port 3307 --user root --pass 'password' --target "$(pwd)" db_backup.tgz
INFO[0000] beginning restore                             run=a803e093-77ce-49eb-9295-d5af606d2957
INFO[0486] Restore complete

Signed-off-by: Akkuman <akkumans@qq.com>
@akkuman akkuman force-pushed the fix/restore-support-mpt branch from 272519b to 3615798 Compare February 27, 2026 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant