First I need to indicate that I ran the sql file for the Wikipedia dump on my machine, and to be able to run that I needed to update many settings regarding the index size available on memory and some other settings. I just want to mention that those large sql queries were run successfully and I didn't have any problem regarding memory or time out.
首先,我需要指出我在我的机器上运行了Wikipedia转储的sql文件,并且能够运行我需要更新许多有关内存和其他设置上可用索引大小的设置。我只想提一下,那些大的SQL查询运行成功,我没有任何关于内存或超时的问题。
Now I have a table pagelinks (pl_from, pl_title) that shows the links that appears in each wikipedia page, for example the data can be (1, "title1"), (1,"title2"), (2, "title3"), (2, "title1"). I want to create a table that concat the titles group by pl_from. For that this is my sql query (I am using workbench):
现在我有一个表pagelinks(pl_from,pl_title),显示每个*页面中出现的链接,例如数据可以是(1,“title1”),(1,“title2”),(2,“title3”) ),(2,“title1”)。我想创建一个通过pl_from连接titles组的表。为此,这是我的SQL查询(我正在使用工作台):
SET @@group_concat_max_len=150000;
create table concatpagelinks
(SELECT pl_from, GROUP_CONCAT(pl_title , ' ') as links FROM pagelinks GROUP BY pl_from)
Running this query I got the error : "Lost connection to mysql server during query" and the system asked me again for the password. So I search and found this. Therefore I changed net_read_timeout to 1000 and connect_timeout to 60. It didn't solve the problem, SO I changed the query to :
运行此查询我收到错误:“在查询期间丢失了与mysql服务器的连接”,系统再次询问我密码。所以我搜索并找到了这个。因此我将net_read_timeout更改为1000并将connect_timeout更改为60.它没有解决问题,所以我将查询更改为:
SET @@group_concat_max_len=150000;
create table concatpagelinks
(SELECT pl_from, GROUP_CONCAT(pl_title , ' ') as links FROM pagelinks GROUP BY pl_from limit 0,1000)
Still the same problem, and the amazing thing is that every time the query is run for 600.495 sec and the error happens.
仍然是同样的问题,令人惊奇的是每次查询运行600.495秒并且错误发生。
1 个解决方案
#1
14
You can try to change the timeout value on Workbench. Go to: Edit → Preferences → SQL Editor → DBMS connection read time out
您可以尝试更改Workbench上的超时值。转到:编辑→首选项→SQL编辑器→DBMS连接读取超时
See this post for more details:
有关详细信息,请参阅此帖子:
Error Code: 2013. Lost connection to MySQL server during query
错误代码:2013。查询期间与MySQL服务器的连接丢失
Or try to increase the value in: Edit → Preferences → SQL Editor → DBMS_Connection keep alive interval
或者尝试增加以下值:编辑→首选项→SQL编辑器→DBMS_Connection保持活动间隔
#1
14
You can try to change the timeout value on Workbench. Go to: Edit → Preferences → SQL Editor → DBMS connection read time out
您可以尝试更改Workbench上的超时值。转到:编辑→首选项→SQL编辑器→DBMS连接读取超时
See this post for more details:
有关详细信息,请参阅此帖子:
Error Code: 2013. Lost connection to MySQL server during query
错误代码:2013。查询期间与MySQL服务器的连接丢失
Or try to increase the value in: Edit → Preferences → SQL Editor → DBMS_Connection keep alive interval
或者尝试增加以下值:编辑→首选项→SQL编辑器→DBMS_Connection保持活动间隔