Sometimes when you try to install a component/plugin/module to your Joomla, the installation may time out or you can get an error "MySQL Server has gone away".
This is a known issue when FTP in Joomla is enabled. A common reason for this issue is Joomla FTP being enabled. The upload of the component/plugin/module goes through FTP and this process can be slow, considering the need to establish an FTP connection. The web server and the database server are waiting for a reply at that point and it is possible to timeout. If FTP is disabled, the upload goes directly through PHP and thus the installation process is completed faster and this is not an issues.
You can disable FTP in Joomla from the admin area > Global Configuration > Server > FTP Settings > Enable FTP > No.