Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL Workbench: Reconnecting to database when "MySQL server has gone away"?

I have a lot of tabs and queries open in MySQL workbench. I left it open before I went to sleep, but this morning I am getting an error MySQL server has gone away when trying to run queries.

The database is up, and I am able to connect to it if I open a new connection on MySQL workbench, but the current connection is dead. How do I reconnect?

I don't want to open a new connection as I would have to copy my queries and tabs over.

like image 289
BugHunterUK Avatar asked Feb 08 '16 09:02

BugHunterUK


People also ask

Could not connect to the database server MySQL server has gone away?

The most common reason for the MySQL server has gone away error is that the server timed out and closed the connection. In this case, you normally get one of the following error codes (which one you get is operating system-dependent). The client couldn't send a question to the server.

Does MySQL automatically close connections?

When using something like cgi, it's completely unnecessary to close your mysql connections since they close automatically at the end of script execution.


1 Answers

Done it.

Query Menu -> Reconnect to Server 
like image 92
BugHunterUK Avatar answered Sep 28 '22 17:09

BugHunterUK