[Err] 2006 - Solution for MySQL server has gone away

MySQL (Navicat) reports an error when running the .sql file: [Err] 2006 - Solution for MySQL server has gone away

When importing SQL database structure + data, if the data is inserted in batches, an error will be reported: 2006 - MySQL server has gone away.

Solution: Find the my.ini configuration file in your mysql directory and add the following code

max_allowed_packet=500M

wait_timeout=288000

interactive_timeout = 288000

Change the value according to your own situation, and finally remember to restart your mysql service

In this way, the MySQL server has gone away problem can be well solved. max_allowed_packet is the maximum data packet allowed by mysql, that is, the request you send; wait_timeout is the longest time to wait, this value can be customized, but if the time is too short, the MySQL server has gone away after the timeout # 2006 error. The role of the max_allowed_packet parameter is to control the maximum length of its communication buffer.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326036092&siteId=291194637