Lost connection to server during query / MySQL has gone away

Forum related to MySQL

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 796
Joined: 18.11.2018, 17:37
Location: Hungary

Lost connection to server during query / MySQL has gone away

Post by aehimself »

Hello,

I'm using Delphi 10.2 with Zeos 7.2.4-stable to connect to a MySQL 8.0.13 server using (the latest available, 8.0 is not yet included in the Windows installer) libmysql.dll version: 6.1.11.
When I am debugging my application (connected to the DB via WLAN) I am greeted with the above two messages quite often, especially if I pause the execution with a breakpoint. This seems not to happen when my program is running outside of the IDE, on the database server OR using an older (5.x) version of mysql.dll. wait_timeout is left at the defult value (28800 seconds, which should be 8 hours) and I am not even close to that delay.

I am suspecting that the weak link will be the Wifi, but shouldn't the server wait for my query a little bit... longer?
It is not really that disturbing as it doesn't seem to happen in release. I'm just wondering if any of you already met this issue and if yes - did you manage to fix it somehow?

Cheers!
Delphi 12.2, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 796
Joined: 18.11.2018, 17:37
Location: Hungary

Re: Lost connection to server during query / MySQL has gone away

Post by aehimself »

I guess we can take the WLAN out of the question :) Today the same happened when I was using a wired connection.
After the usual "Lost connection" a couple of access violation errors and sometimes my application just hangs endlessly, it does not even want to shut down by itself (it gets stuck when it tries to reconnect to the database),

I guess Oracle did it again. In the moment I change libmyqsl.dll with libmariadb.dll, all errors go away.

As this was not the first anomaly with the official connector, I am seriously thinking on switching to MariaDB... maybe it would bring less pain in my life :)
Delphi 12.2, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
Post Reply