Q:

Getting MYSQL Error: "Error Code: 2006 - MySQL server has gone away"

I am getting following error, when I try to import MYSQL database:
Error Code: 2013 - Lost connection to MySQL server during queryQuery:
Error Code: 2006 - MySQL server has gone away

Can someone let me know what is wrong?

A:

Investigation shows many solutions correctly talking about setting the max_allowed_packet and wait_timeout for mysql in my.cnf; small addendum that the default install of mysql on mac osx doesn't appear to include this file.  You may first need to create it at /etc/my.cnf (this is only an issue if you're using the default install of mysql instead of a mamp stack or similar)
contents of /etc/my.cnf that corrected this issue for me below:
[mysqld]
max_allowed_packet= 64M
wait_timeout= 6000

A:

Here you can read more about this error and various ways to avoid/solve it
From the docs: 

The most common reason for the MySQL server has gone away error is that the server timed out and closed the connection

A:

Try following 2006 Error related fixes :

Server timed out and closed the connection. 
How to fix: check that wait_timeout variable in your mysqld’s my.cnf configuration file is large enough. 
Server dropped an incorrect or too large packet. If mysqld gets a packet that is too large or incorrect, it assumes that something has gone wrong with the client and closes the connection. You can increase the maximal packet size limit by increasing the value of max_allowed_packet in my.cnf file.

