尝试导入mysql转储时出错

时间:2014-08-16 14:51:38

标签: mysql mysqldump

在尝试导入数据库表时,我收到一条错误消息:

    Error
SQL query:

INSERT INTO `rn2_cache_menu` (`cid`, `data`, `expire`, `created`, `serialized`) VALUES

('links:management:tree-data:en:ec99d3452fef1ede622e66c68ba908b1dad455aa71f5e68648aeec6488b89c88', 
0x613a323a7b733a343a2274726565223b613a313a7b693a313b613a323a7b733a343a226c696e6b223b613a34323a7b733a393a226d656e755f6e616d65223b733a3130
3a226d616e6167656d656e74223b733a343a226d6c6964223b733a313a2231223b733a343a22706c6964223b733a313a2230223b733a393a226c696e6b5f70617468223b73
3a353a2261646d696e223b733a31313a22726f757465725f70617468223b733a353a2261646d696e223b733a31303a226c696e6b5f7469746c65223b733a31343a2241646d
696e697374726174696f6e223b733a373a226f7074696f6e73223b733a363a22613a303a7b7d223b733a363a226d6f64756c65223b733a363a2273797374656d223b733a3
63a2268696464656e223b733a313a2230223b733a383a2265787465726e616c223b733a313a2230223b733a31323a226861735f6368696c6472656e223b733a313a22312
23b733a383a22657870616e646564223b733a313a2230223b733a363a22776569676874223b733a313a2239223b733a353a226465707468223b733a313a22312[...]

MySQL said: Documentation

#2006 - MySQL server has gone away 

这个错误是什么意思?

我已在max_allowed_packet下将[mysqldump]配置为max_allowed_packet = 16M

注意 :在大约150个表中,只有22个表会随着此错误导入!

1 个答案:

答案 0 :(得分:0)

我认为您需要检查连接是否存在,如果不存在则重新建立连接。

此外,您尝试增加变量的超时,如下所示:

SET @@GLOBAL.wait_timeout=300;
SET @@LOCAL.wait_timeout=300;

或者您可以尝试在my.cnf文件中进一步将ma_allowed_pa​​cket增加到64M

max_allowed_packet=64M
wait_timeout= 6000