If you encounter the error 'ERROR 2006 (HY000): MySQL server has gone away' while restoring a large file in MySQL, check the mysql my.cnf file.
Kod:
max_allowed_packet=64M
You can solve the problem by specifying a high number in place of '64M' in the expression. After performing this operation, don't forget to restart MySQL.In MYSQL 5.7, the my.cnf file is generally located in the directory 'C:\ProgramData\MySQL\MySQL Server 5.7', of course, this can be different based on the installation.
Source : ERROR 2006 (HY000): MySQL server has gone away Çözüm Yolu