• 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!

Linux MYSQL ERROR: Lost connection to MySQL server during query

Rodo

New Member
Joined
Oct 23, 2007
Messages
575
Solutions
1
Reaction score
3
Location
Mexico
I'm running TFS 0.4 under debian and I get randomly this error when someone logout


Code:
[7:26:32.767] Xx has logged out.
[7:27:02.767] mysql_real_query(): UPDATE `players` SET `lastlogin` = 1290755373, `lastip` = 2173476041, `level` = 22, `group_id` = 1, `health` = 395, `healthmax` = 395, `experience` = 136797, `lookbody` = 0, `lookfeet` = 0, `lookhead` = 2, `looklegs` = 40, `looktype` = 129, `lookaddons` = 0, `maglevel` = 3, `mana` = 350, `manamax` = 350, `manaspent` = 3826, `soul` = 100, `town_id` = 1, `posx` = 413, `posy` = 500, `posz` = 6, `cap` = 3480, `sex` = 1, `balance` = 0, `stamina` = 150785000, `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '\0\0\0ÿÿÿÿ,L\0\0\Z\0\0\0\00\0\0\0þ', `loss_experience` = 100, `loss_mana` = 0, `loss_skills` = 0, `loss_containers` = 100, `loss_items` = 100, `lastlogout` = 1290756366, `marriage` = 0, `vocation` = 3 WHERE `id` = 12 LIMIT 1; - MYSQL ERROR: Lost connection to MySQL server during query (2013)
[7:27:02.768] Error while saving player: Xx.
 
Execute This In PhPmyadmin

PHP:
UPDATE `players` SET `lastlogin` = 1290755373, `lastip` = 2173476041, `level` = 22, `group_id` = 1, `health` = 395, `healthmax` = 395, `experience` = 136797, `lookbody` = 0, `lookfeet` = 0, `lookhead` = 2, `looklegs` = 40, `looktype` = 129, `lookaddons` = 0, `maglevel` = 3, `mana` = 350, `manamax` = 350, `manaspent` = 3826, `soul` = 100, `town_id` = 1, `posx` = 413, `posy` = 500, `posz` = 6, `cap` = 3480, `sex` = 1, `balance` = 0, `stamina` = 150785000, `skull` = 0, `skulltime` = 0, `promotion` = 0, `conditions` = '0', `loss_experience` = 100, `loss_mana` = 0, `loss_skills` = 0, `loss_containers` = 100, `loss_items` = 100, `lastlogout` = 1290756366, `marriage` = 0, `vocation` = 3 WHERE `id` = 12 LIMIT 1
 
Then it's with your login.lua
Try this out :

Lua:
local config = {
	loginMessage = getConfigValue('loginMessage'),
	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
	elseif(accountManager == MANAGER_NAMELOCK) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
	elseif(accountManager == MANAGER_ACCOUNT) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")

	registerCreatureEvent(cid, "Idle")
	if(config.useFragHandler) then
		registerCreatureEvent(cid, "SkullCheck")
	end

	registerCreatureEvent(cid, "ReportBug")
	registerCreatureEvent(cid, "AdvanceSave")
	return true
end
 
"Lost connection to MySQL server during query ."
If it happens randomly then it's most likely TFS fault in which case you can't do nothing about that...
If it happens always it's your scripts fault.
 
"Lost connection to MySQL server during query ."
If it happens randomly then it's most likely TFS fault in which case you can't do nothing about that...
If it happens always it's your scripts fault.

He says it's happening whenever it's on startup.
Is it possible he compiled wrong?
 
Then it's with your login.lua
Try this out :

Lua:
local config = {
	loginMessage = getConfigValue('loginMessage'),
	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
	elseif(accountManager == MANAGER_NAMELOCK) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
	elseif(accountManager == MANAGER_ACCOUNT) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")

	registerCreatureEvent(cid, "Idle")
	if(config.useFragHandler) then
		registerCreatureEvent(cid, "SkullCheck")
	end

	registerCreatureEvent(cid, "ReportBug")
	registerCreatureEvent(cid, "AdvanceSave")
	return true
end



My login.lua actually looks like that one.
 
Well, actually gettin this instead:


Code:
[0:52:59.485] >> Test server Online!

theforgottenserver: /usr/include/boost/thread/pthread/condition_variable_fwd.hpp:38: boost::condition_variable::~condition_variable(): Assertion `!pthread_cond_destroy(&cond)' failed.
Aborted


And the server close after 5 seconds of the welcome message "server Online!"
 
Well, actually gettin this instead:


Code:
[0:52:59.485] >> Test server Online!

theforgottenserver: /usr/include/boost/thread/pthread/condition_variable_fwd.hpp:38: boost::condition_variable::~condition_variable(): Assertion `!pthread_cond_destroy(&cond)' failed.
Aborted


And the server close after 5 seconds of the welcome message "server Online!"

post your "condition_variable_fwd.hpp"
in your usr folder in Modern AAC
 
Back
Top