You might encounter an error message that says something like “Error 2### HY### Connection Time Out” in MySQL when importing huge backup files to your database. This totally perplexed me as I thought at first the problem came from within my backup file. Maybe the SQL statements were incorrect or something.
Turns out, you have to set max_allowed_packet = 32M in either your MySQL’s config file (my.cnf or my.ini) to increase the memory. You will then have no problems importing your file back to the database. Just remember, if it is a big file, it will take some time to finish importing everything.