Ask Your Question

mysql server has gone away [closed]

asked 2016-10-06 18:51:09 +0200

EasyTrieve gravatar image

updated 2020-09-13 09:22:50 +0200

Alex Kemp gravatar image

I sometimes randomly get: "mysql server has gone away" when connecting LibreOffice Base to MySQL. I must reestart Base before I can proceed.

I'm using:

  • OS: Debian 8.6 (Jessie stable)
  • Database server: MariaDB 10.1 MySQL Server (the most recent version)
  • App: LibrieOffice Base (the most recent version)
  • Extension: mysql connector 1.0.4_3 ("MySQL Native Connector for Linux for 4.2 and 4.3") (the most recent version)

Normally with database connectors there is a place to set up connection parameters. One such parameter in a connector I've used is "keep-alive" which fixed this behavior for me before.

But I'm not sure where to set up any connection parameters for this extension.

Furthermore, I don't know who produced or supports this connector. (See: LibreOffice | Base | Tools | Extension Manager | Get more extensions online... | Extensions | Base-extensions | MySQL Native Connector for Linux for 4.2 and 4.3). The only reference there is to: which is just a generic home.

Any help is much appreciated.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2020-09-13 09:23:25.426430

1 Answer

Sort by » oldest newest most voted

answered 2016-10-06 22:08:43 +0200

EasyTrieve gravatar image
  1. Stop your MySQL server, (In linux: services mysql stop),
  2. in /etc/my.cnf check and possibly increase the value of wait_timeout. Mine was set at 600 (seconds, or 10 minutes) but you can set it much higher, and MySQL says the "default" is 28800 (or 480 minutes, = 8 hours).
  3. Restart your MySQL server, (In linux: services mysql start),


. "The MySQL server has gone away has two main causes and solutions:

Server timed out and closed the connection. To fix, check that “wait_timeout” mysql variable in your my.cnf configuration file is large enough.

Server dropped an incorrect or too large packet. If mysqld gets a packet that is too large or incorrect, it assumes that something has gone wrong with the client and closes the connection. To fix, you can increase the maximal packet size limit “max_allowed_packet” in my.cnf file, eg. set max_allowed_packet = 128M, then sudo /etc/init.d/mysql restart."
edit flag offensive delete link more


This would be a great solution when you control the server, but mine is at a hosting service. I need to be able to reconnect from LO after it has disconnected so I don't lose data entered painstakingly into a form..

bwilson gravatar imagebwilson ( 2020-04-03 01:22:17 +0200 )edit

Question Tools

1 follower


Asked: 2016-10-06 18:51:09 +0200

Seen: 772 times

Last updated: Oct 06 '16