Craft 3 Ubuntu installation error via composer setup After running composer and then initiating craft setup I keep getting this error:

Username: [admin]
Email: abc@test.com
Password:
Confirm:
Site name: test
Site URL: test.com
Site language: [en-US]
Installing Craft...

Exception 'craft\errors\MigrationException' with message 'An error occurred while executing the "craft\migrations\Install migration: Error while sending QUERY packet. PID=25472'

in /vendor/craftcms/cms/src/db/MigrationManager.php:267


My MySQL version is 5.7.18-0ubuntu0.16.04.1.
[SOLVED] By upping wait_timeout from 10 to 100 in my.cnf - seems to have fixed the issue. 

Initial google searches for "Error while sending QUERY packet" led me to increase max_allowed_packet size, but this didn't fix the problem alone. 
Note, I'm not sure if both timeout and packet size need to be increased or just timeout nevertheless I have increased both and it works now.

Another side note on my server setup, the server I had problem with was a default Vesta CP ubuntu/mysql configuration. I had no problem installing Craft 3 on a different ubuntu 16 configured by Serverpilot.io.