Magento 2.1.18 is the final 2.1.x release. After June 2019, Magento 2.1.x will no longer receive security patches, quality fixes, or documentation updates.
To maintain your site's performance, security, and PCI compliance, upgrade to the latest version of Magento.

Error 'MySQL server has gone away' during installation

Details

During installation, the following message displays:

1
MySQL server has gone away

Solution

Set the value of table_open_cache to a value of at least 250 as follows:

  1. As a user with root privileges, open the MySQL configuration file in a text editor.

    Ubuntu 16: /etc/mysql/mysql.conf.d/mysqld.cnf

    Ubuntu earlier than 16: /etc/mysql/my.cnf

    CentOS: /etc/my.cnf

  2. Search for an existing table_open_cache setting. If there is none, add one.

  3. Set the value to at least 250:

    1
    
    table_open_cache=250
    
  4. Save your changes to my.cnf and exit the text editor.

  5. As a user with root privileges, restart the MySQL service:

    Ubuntu: service mysql restart

    CentOS: service mysqld restart

Updated