• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[SQL Connection with Latest TFS lost]

Status
Not open for further replies.

Zonet

Web Developer
Joined
Sep 1, 2008
Messages
4,393
Reaction score
52
Location
Tibia VS RL-life, guess whos back?
Hello everyone i got a War script bought from nahruto [<3]
And with the latest TFS in config there's something

mysqlReadTimeout = 10 <-- this one.

My friend got this script too, he is using gui and getting this problem

in the console] Access denied for user 'ODBC'@'localhost' (using password: YES)

and i'm getting this error [using my kill.lua with svargrond arena.]

I'm getting error in line 12 <-->
PHP:
if enemyGuild == getGuildWarInfo(myGuild).With then


and this getGuildWarInfo(myGuild).With <---use sql

so, i think it is TFS problem, i'll now post my latest config and the old config. my screen first.

68zuqf.jpg

Latest.

sqlType = "mysql"
sqlHost = "localhost"
sqlPort = 3306
sqlUser = "root"
sqlPass = "pass"
sqlDatabase = "dbname"
sqlFile = "forgottenserver.s3db"
sqlKeepAlive = 60
mysqlReadTimeout = 10
optimizeDatabaseAtStartup = "yes"
passwordType = "plain"


Old

sqlType = "mysql"
sqlHost = "localhost"
sqlPort = 3306
sqlUser = "root"
sqlPass = "pass"
sqlDatabase = "dbname"
sqlFile = "forgottenserver.s3db"
sqlKeepAlive = 60
optimizeDatabaseAtStartup = "yes"
passwordType = "plain"


i hope any of TFS developers take a look, what is wrong it that since when it lost the connection my server crashes.


Thank you.
 
Last edited:
After moving database to linux with boolean value=1 it's been up for 30 hours for me, then i had to reboot the linux, was fixing some things with new installed debian.
 
I think why the TFS connecition loses, depends on the online players too.
If many online players = faster connection lose .

100% since when i had 70~online day, i've had y server on like 2 days..

when i got 170 it lost the connection.
 
Elf said that in 0.3.2 this problem doesn't exist but when it will be released no-one-knows.

As a temporary "fix" you may bump up MAX_RECONNECT_ATTEMPTS so the server will cease to try reconnecting after a bigger number of attempts.

Just go to databasemysql.h and edit
Code:
#define MAX_RECONNECT_ATTEMPTS 3

If you want to know how many fails there were go to
Code:
bool DatabaseMySQL::reconnect()
and paste after "{"
Code:
std::cout << "%% MySQL Error, reconnecting... (no. " <<m_attempts << ") %%" << std::endl;

There for sure is better way to fix that. In fact that method only hide a problem but it's more than doing nothing with it.
 
Elf said that in 0.3.2 this problem doesn't exist but when it will be released no-one-knows.

As a temporary "fix" you may bump up MAX_RECONNECT_ATTEMPTS so the server will cease to try reconnecting after a bigger number of attempts.

Just go to databasemysql.h and edit
Code:
#define MAX_RECONNECT_ATTEMPTS 3

If you want to know how many fails there were go to
Code:
bool DatabaseMySQL::reconnect()
and paste after "{"
Code:
std::cout << "%% MySQL Error, reconnecting... (no. " <<m_attempts << ") %%" << std::endl;

There for sure is better way to fix that. In fact that method only hide a problem but it's more than doing nothing with it.

Like this?

Code:
#ifndef __DISABLE_DIRTY_RECONNECT__
bool DatabaseMySQL::reconnect()
{
std::cout << "%% MySQL Error, reconnecting... (no. " <<m_attempts << ") %%" << std::endl;
	if(m_attempts > MAX_RECONNECT_ATTEMPTS)
	{
		std::cout << "Failed reconnecting to database - MYSQL ERROR: " << mysql_error(&m_handle) << std::endl;
		m_connected = false;
		return false;
	}

	if(mysql_ping(&m_handle))
		m_attempts = 0;
	else
		m_attempts++;

	return true;
}
 
@up - Your brain is extraordinary as it has noticed that ;O

@kleksu - Exactly, but it's just a way to inform you that reconnecting attempt was performed.
 
Status
Not open for further replies.

Similar threads

Back
Top