简体   繁体   中英

Importing sqldump into docker-container

I am trying to import a sqldump into a running MySQL Docker-Container with this command:

 sudo docker exec -i a2bdd4db352a /usr/bin/mysql -u username -ppassword --max_allowed_packet=1500M --default-character-set=utf8 database < /srv/Dump.sql

After a while getting these error:

ERROR 2006 (HY000) at line 979: MySQL server has gone away
read unix @->/var/run/docker.sock: read: connection reset by peer

Logs:

2017-12-07T09:44:21.099302Z 3 [Note] Aborted connection 3 to db: 'database' user: 'database' host: 'localhost' (Got a packet bigger than 'max_allowed_packet' bytes)

Tried to increase the max_allowed_package variable in my MySQL-Conf ---> Nothing changed - still the same error.

My Dump has a size of 16 GB.

Has anybody a idea - how to fix this?

Error says the particular row data has size more than 1500M, so try increasing max_allowed_packet to higher value

For detailed info refer below link http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_max_allowed_packet

您是否尝试将参数--max_allowed_packet=1500M增加到--max_allowed_packet=200000M吗?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM