Take the 2-minute tour ×  I need to execute a SQL dump with very
large extended inserts. I'm using the official command-line tool
in my computer to connect to a server in the LAN. The execution
always dies:  ERROR 2006 (HY000): MySQL server has gone away
... and I've fairly sure that it's due to a tiny
max_allowed_packet setting:  mysql> SHOW VARIABLES LIKE
'max_allowed_packet'; | Variable_name      | Value    | |
max_allowed_packet | 10485760 |  There're lots of documentation
on how to change the setting in the server but I wonder if it's
possible to change it just for current connection, i.e., from
the client side. I don't need a general solution, I'll be happy
if it works for the command line tool.  I've checked
documentation and found this:    ... and subsequently tried
this:  mysql ^     --max_allowed_packet=50M ^     --compress ^
--default-character-set=utf8 ^     --skip-reconnect ^     -h
mysql.example.com -u foo -b bar  Result: all commands to read
max_allowed_packet still report 10MB and server