Generally a “server gone away” during import error is either max_allowed_packet or wait_timeout related. I see that you are setting your max_allowed_packet for the mysql client to 2G (though the max is 1G, so it should default back to that), but what is your server value of max_allowed_packet set to? The import will be limited by whichever one of those is the lowest, so if your server is set to the default, then that is likely the issue. After that I would check the wait_timeout value on your server and increase that if it is set to something smaller than the default.
I met the " MySQL server has gone away" problem when I tried to apply the binlog to a test database in order to update its data. I had three binlog files and one of them is 2G and the others are 1G approximately. After I met the problem, I set the “max_allowed_packet” to 1G and the “wait_timeout” to 2880000, but I got the error still. Is there anything I can do to solve it? BTW, my database version is MySQL 5.6.25.