Site Down with General Error: 2006 MySQL server has gone away

I recently got this error message while working on a Drupal 7.22 website. See screenshot.

Sometimes it's hard to find the sollution to this problem. The error message is so wordy and goes on for several lines. When searching Google for a solution, what search phrase do you use? Do you search for "Uncaught Exception in Shutdown Function" or "General Error: 2006 MySQL server has gone away"?

Here are some solutions to this problem.
1. Press F5 on your browser to refresh the screen. For some people, this simple step solved the problem.

2. Edit your my.ini configuration file to increase max allowed packet size.

Look in your folder named c://xampp/mysql/bin

Find the config file called my.ini
This is the mySQL configuration file. The max_allowed_packet size is set too low by default. Mine was set to 1M. Sometimes it is set to 16M. This setting may introduce this exception error in your Drupal 7 website.

To resolve this problem, you need to increase max_allowed_packet variable in MySQL.

Edit the following line in my.ini

max_allowed_packet = 100M

Save the file and restart MySQL service. From now on, you will never get this kind of exception in your Drupal website.