I got this error while importing large database dump from command line.
I searched and found out that it is related to the default max_allowed_packet which is 16M, so i need to increase this setting from Mysql:
1.) Change setting on my.cnf and restart mysql:
2.) Change setting temporarily. Login to MySQL and issue:
Note: You may want to restart your Mysql to reload your previous/default settings.