Error: MySQL server has gone away
while uploading a module, plugin, template in your Joomla website
When uploading an extension (module, plugin, template) to your hosting server for installation, the process may unexpectedly quit or display the MySQL Server has gone away error.
The most common cause of this error is probably the FTP that is enabled in your installation. Through it the extension's files are uploaded. Depending on the size of the installation files the process can be slow because of the FTP connection. If the process is taking too long to complete the server terminates to consume resources.
If this happens to you too, you can disable FTP and upload your files directly through PHP. This way, the uploading process will be completed quicker.
To disable FTP navigate to System > Global Configuration and find the Server tab. Inside there under the FTP Settings category change the Enable FTP setting to No.
Now try to upload your files again to see if the problem has been fixed.