MySQL R7 Connection lost? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL R7 Connection lost? (
/showthread.php?tid=371832)
MySQL R7 Connection lost? -
wups - 24.08.2012
I've posted this in the mysql plugin topic, but I didn't get any help there.
Quote:
[13 16:14:18]Error id 2013: Lost connection to MySQL server during query('SELECT 1 FROM `Account` WHERE `Xp`>0 AND `IP`='SOME_IP_HERE'')
I get a few of these errors everyday.
In R6, I could fix it using this:
pawn Code:
public OnQueryError(errorid, error[], callback[], query[], connectionHandle)
{
if(errorid==CR_SERVER_LOST) mysql_query(query);
}
But now, in R7, I can't, because there are additional parameters, that I can't get with this callback(like playerid).
Any ideas on how to fix this?
Note: I have mutex disabled, because I think it caused some random crashes earlier.
Note2: I connect to mysql using the external IP, not 127.0.0.1. That way, I can test my gamemode on my local pc.
|
Re: MySQL R7 Connection lost? -
wups - 25.08.2012
Anyone?
Respuesta: MySQL R7 Connection lost? -
[DOG]irinel1996 - 25.08.2012
Seems strange, in my opinion SQL syntax is OK.
Also, give a try with this:
pawn Код:
new query[128];
mysql_format(connection,query,"SELECT * FROM Account WHERE Xp > 0 AND IP='%s'",ip);
mysql_function_query(connection,query,false,"","");
Following your way to fix it in R6, in R7 is possible to make something very similar using threaded scripts I think, calling
OnQueryFinish, or
OnQueryError.
Try replace your public IP by localhost, to see if there is any changes.
Re: Respuesta: MySQL R7 Connection lost? -
wups - 25.08.2012
Quote:
Originally Posted by irinel1996
Seems strange, in my opinion SQL syntax is OK.
Also, give a try with this:
pawn Код:
new query[128]; mysql_format(connection,query,"SELECT * FROM Account WHERE Xp > 0 AND IP='%s'",ip); mysql_function_query(connection,query,false,"","");
Following your way to fix it in R6, in R7 is possible to make something very similar using threaded scripts I think, using OnQueryFinish, or OnQueryError.
Try replace your public IP by localhost, to see if there is any changes.
|
I'm not sure what to use on linux: "localhost" or "127.0.0.1"?
Respuesta: Re: Respuesta: MySQL R7 Connection lost? -
[DOG]irinel1996 - 25.08.2012
Quote:
Originally Posted by wups
I'm not sure what to use on linux: "localhost" or "127.0.0.1"?
|
Both should work correctly.
I rate more for
127.0.0.1