MySQL R7 Connection lost?
#1

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.

Reply
#2

Anyone?
Reply
#3

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.
Reply
#4

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"?
Reply
#5

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)