How to fix "Lost connection to MySQL server during query" on importing a dump to MySQL in Magento Cloud?

Add the --max-allowed-packet=1073741824 parameter to the mysql command, e.g.:

mysql --host='database.internal' --user=user --password='' --default-character-set=utf8 --max-allowed-packet=1073741824 main < dump.sql