MySQL: A reconnect after "Server has gone away" error lazarus / 16-Databases ---------------------------------------------------------------------- hubblec4 · 2014-07-16 13:35 Hi everyone I have an issue with the SQLConnection. Sometimes i get this "... gone away"-error. My aim is it to handle this error with an automaticly reconnect to the Sql-server. The error is not caused by a timeout! (there are many stuff for this topic but no information for an reconnect) I use the SQL_Library_Loader, SQLConnector, SQLTransaction, SQLQuery and a DataSource. I found a public property at the SQLConnector "SQLConnector.ConnOptions" how i can use this property, which options i can set? hubble ---------------------------------------------------------------------- hubblec4 · 2014-07-17 09:20 When i try SQLConnector.connected:=false i get the same "...gone away"-error. There is no chance for a reconnect to the SQL-DB. only when i restart my programm. Or anyone knows how to do that? ---------------------------------------------------------------------- LacaK · 2014-07-21 07:44 Try use SQLConnector.Close(True); or SQLConnector.Proxy.Close(True); Parameter "ForceClose" = True ---------------------------------------------------------------------- hubblec4 · 2014-07-21 09:32 ok i will try it. EDIT: SQL.Connectore.Close(True) dont work, you get the same "gone away -error", cause allways a rollback is attempted. But we talked in the german forum and we found the bug. (http://www.lazarusforum.de/viewtopic.php?f=17&t=7953) http://bugs.freepascal.org/view.php?id=26505 ---------------------------------------------------------------------- LacaK · 2014-07-21 11:59 Can you post here any compilable simple application which will show error ? ---------------------------------------------------------------------- hubblec4 · 2014-07-21 14:11 Quote from: LacaK on July 21, 2014, 01:59:39 pmCan you post here any compilable simple application which will show error ? Sorry not really. I can't extract der Fail-procedure to a simple application. ---------------------------------------------------------------------- Michl · 2014-07-21 22:04 I can. Please read the bug tracker entry first. With the one of the last patchs it is possible to execute the two buttonclicks in the .exe. You have to copy "libmysql.dll" in your project order. I use MySQL 5.6 if you use a other version, you have to change the Connection (with the name Connection!). Parameters are written in the private section of TForm1 and setted in TForm1.FormCreate.