Lost connection to MySQL server during query
Lost connection to MySQL server during query
Hi Guys,
Sometimes, my customer is getting an error with the message "Lost connection to MySQL server during query". Nowaday, i already have an implementation to surround this problem, so i would like this message was not showed. Is it possible ?
Sometimes, my customer is getting an error with the message "Lost connection to MySQL server during query". Nowaday, i already have an implementation to surround this problem, so i would like this message was not showed. Is it possible ?
- nageswaragunupudi
- Posts: 10691
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Lost connection to MySQL server during query
What is your implementation please?Nowaday, i already have an implementation to surround this problem,
This message is displayed if and when the connection with the server is lost when the application is trying to access the server.
This mostly happens due to physical disconnection of cables or loss of internet in case of cloud servers, etc.
This message is intended to advise the user to restore the physical connection and try the operation again. We considered this important instead of just keeping the application hanging and keeping the user in suspense.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Lost connection to MySQL server during query
Hi Vilian
You can check if the "my.cnf" file has this line:
wait_timeout=28800
Best regards
Carlos
You can check if the "my.cnf" file has this line:
wait_timeout=28800
Best regards
Carlos
- nageswaragunupudi
- Posts: 10691
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Lost connection to MySQL server during query
TimeOut is not at all a problem for FWHmaria librarycsincuir wrote:Hi Vilian
You can check if the "my.cnf" file has this line:
wait_timeout=28800
Best regards
Carlos
Yes, after the time out period, the connection with the sever is lost.
Even then, if the user's operation requires, the library will again connect to the server and proceed.
Whether you set time our not, nothing can stop our program.
Only if the PC can not communicate with the server for other reasons physical or lack of internet, this message is displayed
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Lost connection to MySQL server during query
I just try after the command if nError <> 0, and in this case, I repeat the the command. Something like this:nageswaragunupudi wrote:What is your implementation please?
Code: Select all | Expand
oQry := oBD:Query("SELECT * FROM ttartes LIMIT 1")
IF (nRet := ::CheckBD()) < 0
RETURN lRet
ELSEIF nRet = 1
oQry := oBD:Query("SELECT * FROM ttartes LIMIT 1")
ENDIF
METHOD CheckBD() CLASS TTarTes
IF oEmpresa:oBD:nError == 0
RETURN 0
ELSEIF oEmpresa:oBD:Connect()
RETURN 1
ELSE
MsgInfo("Ocorreu uma falha na conexão com o BD com a seguinte mensagem:"+CRLF+oEmpresa:oBD:cError,"Atenção")
ENDIF
RETURN -1
Re: Lost connection to MySQL server during query
Is it possible ?
Re: Lost connection to MySQL server during query
This can work if you use only a table.
However, if you had previously opened other tables, do you find them closed?
It is a problem that even when the internet connection is not stable
Maurzio
However, if you had previously opened other tables, do you find them closed?
It is a problem that even when the internet connection is not stable
Maurzio
Re: Lost connection to MySQL server during query
Maurizio,
I understood what you are saying, but in this case, I'm always checking for errors, so i really dont need this message. This is just disturbing my customer and me too.
I understood what you are saying, but in this case, I'm always checking for errors, so i really dont need this message. This is just disturbing my customer and me too.
- nageswaragunupudi
- Posts: 10691
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Lost connection to MySQL server during query
Mr. Vilian
You do not need to write any code to check the errors.
FWH Library already does it for you.
You do not need to repeat in your code, what FWH library has already done it.
You do not need to write any code to check the errors.
FWH Library already does it for you.
You do not need to repeat in your code, what FWH library has already done it.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Lost connection to MySQL server during query
Sorry, but if i don't do this, every time i had a "Lost Connection", i will have an error message. So, with this code i can avoid the error message, but i can't avoid "Lost connection" message.
Please, provide something to avoid it.
Please, provide something to avoid it.
- nageswaragunupudi
- Posts: 10691
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Lost connection to MySQL server during query
If not our "lost connection" message, you are giving your own custom message. Right?vilian wrote:Sorry, but if i don't do this, every time i had a "Lost Connection", i will have an error message. So, with this code i can avoid the error message, but i can't avoid "Lost connection" message.
Please, provide something to avoid it.
We can provide for showing your custom message instead of the library's built in message.
Is that okay?
But please keep in mind, you do not need to try to reconnect.
All that kind of work, the library has already done.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Lost connection to MySQL server during query
No my friend. I dont want my own custom message. I just wanted recover the conexion with the mysql server and continue running without show any message.
-
- Posts: 465
- Joined: Sun Oct 30, 2005 6:37 am
- Location: Guangzhou(Canton),China
- Contact:
Re: Lost connection to MySQL server during query
Some viruses or trojans can cut down connection.
Your connecting line may with serious problem, our customers use tmysql 20 years with no the problem in normal via bandwidth >0.2M bits .
Your connecting line may with serious problem, our customers use tmysql 20 years with no the problem in normal via bandwidth >0.2M bits .
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Re: Lost connection to MySQL server during query
Sorry Shuming ,
your comment does not help to solve the problem ,
but above all it is your situation that is not the same for everyone
Maurizio
your comment does not help to solve the problem ,
but above all it is your situation that is not the same for everyone
Maurizio
Re: Lost connection to MySQL server during query
Good Afternoon Mr Rao,
IF I try to do this:
oRs := oBD:Query("SELECT * FROM customers")
oRs:SetOrder("name")
And the mysql connection has been lost, there will be an error in oRs:SetOrder("name"), like this:
ERROR BASE/1004 Message not found NIL:SetOrder
What should I to do for avoid this error and allow my program continue running?
IF I try to do this:
oRs := oBD:Query("SELECT * FROM customers")
oRs:SetOrder("name")
And the mysql connection has been lost, there will be an error in oRs:SetOrder("name"), like this:
ERROR BASE/1004 Message not found NIL:SetOrder
What should I to do for avoid this error and allow my program continue running?