【问题标题】:Mysql: Error Code: 2013. Lost connection to MySQL server during queryMysql:错误代码:2013。在查询期间丢失与 MySQL 服务器的连接
【发布时间】:2015-10-21 22:10:57
【问题描述】:

我将 xml 加载到 mysql 数据库。但它在 600 秒后报告“错误代码:2013。在查询期间丢失与 MySQL 服务器的连接”。

mysql版本:mysql-installer-community-5.7.9.0

加载代码:

CREATE TABLE posts (
Id INT NOT NULL PRIMARY KEY,
PostTypeId SMALLINT,
AcceptedAnswerId INT,
CreationDate DATETIME,
Score INT NULL,
ViewCount INT NULL,
Body text NULL,
OwnerUserId INT,
LastEditorUserId INT,
LastEditDate DATETIME,
LastActivityDate DATETIME,
Title varchar(256),
Tags VARCHAR(256),
AnswerCount INT,
CommentCount INT,
FavoriteCount INT,
CommunityOwnedDate DATETIME,
ParentId INT       

);

load xml infile 'E:/Input/Posts.xml'
into table posts
rows identified by '<row>';

我已使用以下参数修改了文件 ''my.ini'':

max_allowed_packet = 1024M
interactive_timeout = 2880000000
connect_timeout = 2880000000
net_write_timeout = 2880000000
wait_timeout = 2880000000
net_read_timeout = 2880000000

我没有找到有关错误的任何解决方案。 有人可以帮我修复这个错误吗?

【问题讨论】:

  • Posts.xml 很大,36GB。当 Duration/Fetch 为 600 秒时出现错误。
  • 了解发布有关文件的详细信息有何意义。处理可能需要很长时间才能在超时内完成。

标签: mysql


【解决方案1】:

我找出了错误。

编辑->首选项->MySQL 会话。设置更大的超时数。

【讨论】:

  • 什么编辑->首选项?你是说 MySQL 工作台?因为你没有在任何地方说这个。
猜你喜欢
  • 2017-05-05
  • 2012-05-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-11-22
  • 1970-01-01
  • 2020-07-26
相关资源
最近更新 更多