MySQL Workbench: how to keep a network connection

Error code: 2013. Lost connection to MySQL server during query

I am using MySQL Workbench. In addition, I run the insert package, about 1000 lines in total ( INSERT INTO mytable SELECT * FROM mysource1; INSERT INTO mytable SELECT * FROM mysource2;...mysource3...mysource4 times 1000 times). Each batch takes a significant amount of time, some of them more than 600 seconds.

How to set up a workstation, continue working in one night without stopping or losing a connection?

+129
sql mysql mysql-workbench connection-timeout
Mar 29 '13 at 22:40
source share
9 answers

From the unavailable internet archive:

Go to Edit β†’ Preferences β†’ SQL Editor and set a higher value for this parameter: timeout to connect to the DBMS (in seconds). For example: 86400.

Close and restart MySQL Workbench. Kill the previously requested request is probably running and the request starts again.

+274
Mar 29 '13 at 22:49
source share

If you use the connection type "Standard TCP / IP over SSH", in the "Settings" β†’ "Other" section there is a field "SSH KeepAlive". It took me quite a while to find it :(

+41
Nov 13 '15 at 20:02
source share

In 5.2.47 (at least on mac) go to the settings location: MySQLWorkbench-> Settings-> SQL Editor

Then you will see both:

Interval of duration of connection to the DBMS (in seconds): Timeout for connection to the DBMS (in seconds):

The latter is where you want to increase the limit from 600 to something more.

+13
Jun 20 '13 at 23:53
source share

In my case, after trying to set the SSH timeout on the command line and in the local server settings. @Lubitel's solution solved the problem with me.

It should be noted that in Workbench 6.2 the setting is now under advanced

enter image description here

+9
Dec 07 '15 at 5:43
source share

If you use the connection type "Standard TCP / IP over SSH", maybe the ssh server does not synchronize time, in which case you will need to edit the related TCPKeepAlive parameters in the / etc / ssh / sshd _config file on your server.

+2
Aug 6 '14 at 11:30
source share

I was getting this 2013 error, and none of the above preference changes did anything to fix this problem. I restarted the mysql service and the problem went away.

+2
Oct 02 '14 at
source share

OK - so this problem drove me crazy - v 6.3.6 on Ubuntu Linux. None of the above solutions worked for me. The connection to the localhost mysql server has always worked fine before. Connecting to a remote server is always a timeout - after about 60 seconds, sometimes after less time, sometimes more.

What ultimately worked for me was updating Workbench to 6.3.9 - no dropped connections.

+2
Jun 21 '17 at 10:51 on
source share

I had a similar problem when CREATE FULLTEXT after 30 seconds:

error

Setting the wait interval for reading the connection to the DBMS to 0 in the menu "Edit" β†’ "Settings" β†’ "SQL Editor" fixed the problem for me:

fix error

Also, I didn't have to restart MySQL Workbench for this to work.

0
Jul 07 '19 at 7:21
source share

in mysql-workbech 5.7 edit-> preference-> SSH β†’ SSH Connect timeout (for connecting to SSH DB) enter image description here

-one
Apr 23 '19 at 9:58 am
source share



All Articles