Linux environment recovery MYSQL database is too large, set max

888u

Last update at :2024-06-26,Edit by888u

When I was tinkering with the website at night, there was a problem with restoring the larger database. When backing up in Linux, use the command to back up directly (Linux VPS uses the command to quickly import/backup the MYSQL database). This is more complete than directly exporting from PHPMYADMIN. If the degree is higher, problems will also occur when using the recovered data. There is an error message such as "ERROR 2006 (HY000) at Line 179: MySQL server has gone away".

Captain informed me that the solution is because the default setting of max_allowed_packet in the Linux environment is too small. The database table is relatively large and the default should be 1MB, so the parameters need to be adjusted.

Here, I am using Linux. In the etc/my.cnf file, find the max_allowed_packet setting. The default is 1MB. We can change it to 10MB or 20MB, as you like. Then restart the website environment and then execute the import database command to completely execute the import database.

PS: If it is a Windows system, find the MYSQL installation directory my.ini, and in the [mysqld] part of the script, add set-variable=max_allowed_packet=20M (size setting). Then restart MYSQL to take effect.

Recommended site searches: registration-free jsp space, Hong Kong ip, ip168, telecom ip agent, expired registered domain name query, foreign cloud server, Alibaba Cloud free virtual host, Wanwang domain name registration official website, website registered domain name query, Suqian server,

Linux environment recovery MYSQL database is too large, set max

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码