I am getting #2006 MySQL server has gone away error in my Database Connection
1. If you are trying to run a big mysql query or else you are trying to import or export the huge database from your end which is highly resource intensive.
2. If you are using a heavy loop or uses mulitple join,union in your query coding.
3. If you are trying to ALTER all the rows in a data intensive table.
To avoid this import the database part by part this should allow you to generate data without any issues.