Page 1 of 1

Problem... (mysql has gone away..)

Posted: 04.03.2009, 22:25
by mmikac
I use D7 and latest ZeOS.
Started working on new project, connecting to remote mySQL server...

But, the simplest possible example doesn't work properly. I tried to debug it, but I just cannot understand what is really going on.

I manage to establich ZConnection to server... it's ok.
I use ZQuery to insert some data to the table... But, when I try to post it to server (just simple ExecSQL on ZQuery SQL...) sometimes (at start) it works, but in most cases returns "mySQL server has gone away" exception.

I even tried to check Connection.Connected on ZQuery and Reconnect/Connect if false... However, ZConnection state is not changed! If I try to make Connect, it is immediatelly connected (also, OnDisconnect event doesn't fire, so I think that server is connected! That's why I don't understand why is "gone away" exception here!?)

I tried Ping/PingServer... it seems to work...
I am confused and paused on simplest thing possible...

Anyone with suggestion? What could be wrong?

Posted: 05.03.2009, 09:51
by iLLiCiT
i am having the same problems.
I'm using ZEos lib with D7 and Mysql 4.0 connecting using libmysql50.dll
(This is done due to soon-to-come mylsq update reasons).
After some time, the connection is droped with the same error message. I even try to connect before each database action but the error still remains and the connection is offline.
I could use the same version libmysql and mysql but the program will be used on several mysql servers with different version (Ranging from 4.0 to 5.0)

So... any advice?

Posted: 23.03.2009, 11:02
by fcodebue
I have the some problem only in one customer, with mySQL 5.1.30 installed on windows SBS 2003
any idea to trace it?

Posted: 24.03.2009, 21:14
by mith
I have this problem too. My solution is to call Connection.Reconnect before any query (like select, update, etc.) is executed. This is not good solution but work for me.

Posted: 25.03.2009, 22:01
by mdaems
I've seen this before when the dll version didn't fit with the server version. Difficult to find out what dll's fit to what servers. Are you using a 5.1 dll or one of the older mysql 5 dll's. Normally you should be able to use a 5.1 dll with the mysql5 protocol.

Mark

Posted: 28.03.2009, 17:28
by fcodebue
mith wrote:I have this problem too. My solution is to call Connection.Reconnect before any query (like select, update, etc.) is executed. This is not good solution but work for me.
ot's really a NOT GOOD solutions...
in my project I have something like 5000 SQL command ;)

Posted: 28.03.2009, 17:30
by fcodebue
mdaems wrote:I've seen this before when the dll version didn't fit with the server version. Difficult to find out what dll's fit to what servers. Are you using a 5.1 dll or one of the older mysql 5 dll's. Normally you should be able to use a 5.1 dll with the mysql5 protocol.

Mark
ok I will insert something to check library (for firebird too )

have you have any idea how I can check dll version?
1. search in path
2. first find check file properties...
3...

Posted: 02.04.2009, 22:06
by Merco
I have the same problem. Only difference is I know what's causing the dreaded "MySQL has gone away" message. The company that runs the MySQL server has set it's "wait timeout varaible" to five minutes (default is 8 hours).
Basically it means that the server will close the connection after five minutes of inactivity. Unfortunately the Zeoslib connection component does not intercept this situation.

So if you have control over your MySQL server check the wait timeout value.

Like Mith said the problem can be triggered by using a reconnect call. But it will be he a hell of a job to implement it. Hopefully someone knows a better solution

Posted: 06.04.2009, 13:13
by zippo
It's a DLL version problem.

Posted: 26.02.2010, 09:34
by uwwin
it's happen because the MySQL server timeout setup is too small, so setup the configuration in my.ini (Windows) or my.conf (Linux)... if you can't setup them, you can check the connection before run Query by

if not (TZConnection.connected) then TZConnection.Connect;


CMIIW

Posted: 17.03.2010, 04:16
by Zeus
If you are using Windows, to find out which dll MySQL is using run WhatsRunning from www.whatsrunning.net and select the Processes tab. Scroll down to mysqld.exe then in the right pane expand the Modules tree and look for the dll or .exe that it is using. You can then expand it and look at the File Version. It will also tell you where the dll is located on your drive.

Zeus