Error Code: 2013 Lost connection to MySQL server during query

天大地大妈咪最大 提交于 2019-12-13 01:27:10

问题


I am executing a query which is giving this error after that its showing another error Error Code: 2006 MySQL server has gone away

I Searched in Google and find some parameters to set like connect_timeout,interactive_timeout and wait_timeout

I increased all the parameters value from its existing value but still that error is showing.

Then i created 2 test table with less no of data, then the query executed well.

My live tables having more then 50k data and i am using federated table in the query

i think due to federated data and a lot of data in my table its taking more time.

My Query

SELECT TBL.NAME1,
   TBL.NAME2 
  FROM (SELECT MLD1.LOGIN_NAME AS NAME1,
           MLD2.LOGIN_NAME AS NAME2 
      FROM FEDERATED_M_LOGIN_DETAILS MLD1 
      JOIN FEDERATED_M_LOGIN_DETAILS MLD2 
     WHERE MLD1.LOGIN_NAME < MLD2.LOGIN_NAME
  ORDER BY NAME1,NAME2) TBL    
WHERE NOT EXISTS (SELECT USER_NAME1,
                      USER_NAME2 
                 FROM CONNECTION C
                WHERE (C.USER_NAME1 = TBL.NAME1 AND C.USER_NAME2 = TBL.NAME2));

Please help me to over come from this problem.

Thanks in advance

来源:https://stackoverflow.com/questions/15631189/error-code-2013-lost-connection-to-mysql-server-during-query

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!