2

I'm trying to work out why my database dump won't import on my new server. I'm using:

mysql --max_allowed_packet=512M -uDB_USERNAME -pPASS DB_NAME < /root/backup.sql

After a while of it running, I then get in /var/log/mysql/error.log:

2017-09-19T15:00:06.077222Z 130 [Note] Aborted connection 130 to db: 'DB_NAME' user: 'DB_USER' host: 'localhost' (Got a packet bigger than 'max_allowed_packet' bytes)

and the "mysql" CLI call comes back with:

ERROR 2006 (HY000) at line 5995: MySQL server has gone away

Here is some of the other mySQL config:

key_buffer_size     = 16M
max_allowed_packet  = 512M
thread_stack        = 192K
thread_cache_size       = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover-options  = BACKUP
#max_connections        = 100
#table_cache            = 64
#thread_concurrency     = 10
#

I'm at a bit of a loss as to what to try. Any suggestions? The SQL file is 7gb, and the table it keeps dying on is 5gb on the old server.

Thanks!

Andrew Newby
  • 1,224

1 Answers1

1

At input line 5995 of your input you should find a line longer than 512M. Adjust your max_allowed_packet to cover it * 1.25 for a little breathing space.