Problem... (mysql has gone away..)
Moderators: gto, cipto_kh, EgonHugeist
Problem... (mysql has gone away..)
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?
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?
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?
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?
I have the some problem only in one customer, with mySQL 5.1.30 installed on windows SBS 2003
any idea to trace it?
any idea to trace it?
Codebue Fabio
P-Soft - http://www.p-soft.biz
Firebird La Comunità Italiana - http://www.firebirdsql.it
GestionaleOpen - http://www.gestionaleopen.org
P-Soft - http://www.p-soft.biz
Firebird La Comunità Italiana - http://www.firebirdsql.it
GestionaleOpen - http://www.gestionaleopen.org
ot's really a NOT GOOD solutions...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.
in my project I have something like 5000 SQL command
Codebue Fabio
P-Soft - http://www.p-soft.biz
Firebird La Comunità Italiana - http://www.firebirdsql.it
GestionaleOpen - http://www.gestionaleopen.org
P-Soft - http://www.p-soft.biz
Firebird La Comunità Italiana - http://www.firebirdsql.it
GestionaleOpen - http://www.gestionaleopen.org
ok I will insert something to check library (for firebird too )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
have you have any idea how I can check dll version?
1. search in path
2. first find check file properties...
3...
Codebue Fabio
P-Soft - http://www.p-soft.biz
Firebird La Comunità Italiana - http://www.firebirdsql.it
GestionaleOpen - http://www.gestionaleopen.org
P-Soft - http://www.p-soft.biz
Firebird La Comunità Italiana - http://www.firebirdsql.it
GestionaleOpen - http://www.gestionaleopen.org
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
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
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
Zeus