我运行了MySQL社区服务器5.6.16,我有一个大小为290MB的mysql转储文件,
我有以下 my.ini 设置
innodb_lock_wait_timeout = 60000000
max_allowed_packet = 8000000000M
当我尝试从转储文件恢复数据库时,我收到错误
#2006 - MySQL server has gone away
如何解决此错误。
RAM Size: 3.00 GB
my.ini
----------------
key_buffer = 16M
max_allowed_packet = 1M
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M
## Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 60000000
答案 0 :(得分:1)
按以下方式更改:
max_allowed_packet = 64M
innodb_buffer_pool_size = 1536M
同时添加以下与ini文件末尾相同的行。
[mysqldump]
quick ##it is already there in your file.
max_allowed_packet = 80000M # change it to 64M as this is more than your total memory.
完成这些更改后,重新启动mysql并立即检查。
如果仍然出现错误,请从错误日志文件中分享今天的错误日志。