• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Common SQL error

Reese

New Member
Joined
Apr 26, 2013
Messages
14
Reaction score
0
I followed this tutorial and managed to get to the point of hosting it with the config changed.

The issue I'm having is I have to change "Localhost" to "127.0.0.1" or the server will give me an SQL error and shut down.
I know the solution is to just change "localhost" to "127.0.0.1" because after that it works, but I'm unable to get onto my server with my other computer (see for explanation) and I'm thinking that might be the issue.
Is there any way around this?

Edit:
I gave up and tried to host the server from my laptop and it worked, but if you'd like to answer this for anyone else, go for it.
Thanks to all that helped :)
 
Last edited:
Post your config.lua here please

Make sure that your global ip is set correctly for the config, but with the new setup if your router/modem does not support loopback you will not be able to connect from another pc on your network without some sort of bypass or personal made loopback adapter on each pc on your network.
 
LUA:
-- The Forgotten Server Config

	-- Account Manager
	accountManager = "yes"
	newPlayerChooseVoc = "yes"
	newPlayerSpawnPosX = 95
	newPlayerSpawnPosY = 117
	newPlayerSpawnPosZ = 7
	newPlayerTownId = 1
	newPlayerLevel = 1
	newPlayerMagicLevel = 0
	generateAccountNumber = "no"

	-- Banishments
	broadcastBanishments = "yes"
	banDays = 7
	finalBanDays = 30
	killsToBan = 0

	-- Battle
	worldType = "pvp"
	hotkeyAimbotEnabled = "yes"
	protectionLevel = 1
	killsToRedSkull = 3
	killsToBlackSkull = 6
	pzLocked = 60000
	criticalHitChance = 7
	removeAmmoWhenUsingDistanceWeapon = "yes"
	removeChargesFromRunes = "yes"
	removeChargesFromWeapons = "yes"
	timeToDecreaseFrags = 24 * 60 * 60 * 1000
	whiteSkullTime = 15 * 60 * 1000
	oldConditionAccuracy = "no"
	stairJumpExhaustion = 2000

	-- Commands
	displayGamemastersWithOnlineCommand = "no"

	-- Connection Config
	ip = "24.141.175.**"
	bindOnlyGlobalAddress = "no"
	loginProtocolPort = 7171
	gameProtocolPort = 7172
	adminProtocolPort = 7171
	statusProtocolPort = 7171
	loginTries = 10
	retryTimeout = 5 * 1000
	loginTimeout = 60 * 1000
	maxPlayers = "1000"
	motd = "Welcome to the Forgotten Server!"
	onePlayerOnlinePerAccount = "yes"
	allowClones = "no"
	serverName = "Forgotten"
	loginMessage = "Welcome to the Forgotten Server!"
	adminLogsEnabled = "no"
	statusTimeout = 5 * 60 * 1000
	replaceKickOnLogin = "yes"

	-- Death
	-- note: Leave deathLosePercent as -1 if you want to use Tibia's
	-- death penalty formula. For the old formula, set it to 10. For
	-- no skill/experience loss, set it to 0.
	deathLosePercent = -1
	deathListEnabled = "yes"
	maxDeathRecords = 5

	-- Guilds
	ingameGuildSystem = "yes"
	levelToCreateGuild = 8
	minGuildNameLength = 4
	maxGuildNameLength = 20

	-- Highscores
	highscoreDisplayPlayers = 15
	updateHighscoresAfterMinutes = 60

	-- Houses
	housePriceEachSQM = 1000
	houseRentPeriod = "never"

	-- Idle
	kickIdlePlayerAfterMinutes = 15

	-- Item Usage
	timeBetweenActions = 200
	timeBetweenExActions = 1000

	-- Map
	mapName = "Melillandia"
	mapAuthor = "Melillandia"
	randomizeTiles = "no"
	mapStorageType = "relational"

	-- Market
	marketEnabled = "yes"
	marketOfferDuration = 30 * 24 * 60 * 60
	premiumToCreateMarketOffer = "yes"
	checkExpiredMarketOffersEachMinutes = 60
	maxMarketOffersAtATimePerPlayer = 100

	-- Messaging
	maxMessageBuffer = 4

	-- MySQL
	mysqlHost = "127.0.0.1" [B]<- That used to be localhost, but I have to change it to get the server up.[/B]
	mysqlUser = "myservername"
	mysqlPass = "passwordtoo"
	mysqlDatabase = "myservernameagain"
	mysqlPort = 3306

	-- Premium Account
	freePremium = "yes"

	-- PVP Server
	displayOnOrOffAtCharlist = "no"
	allowChangeOutfit = "yes"
	noDamageToSameLookfeet = "no"
	experienceByKillingPlayers = "no"

	-- Rates
	rateExp = 5
	rateSkill = 3
	rateLoot = 2
	rateMagic = 3
	rateSpawn = 1

	-- Real Server Save
	-- note: serverSaveHour means like 03:00, not that it will save every 3 hours,
	-- if you want such a system use autoSaveEachMinutes. this serversave method
	-- may be unstable, we recommend using otadmin if you want real serversaves.
	serverSaveEnabled = "no"
	serverSaveHour = 3
	shutdownAtServerSave = "yes"
	cleanMapAtServerSave = "yes"

	-- Server saving
	autoSaveEachMinutes = 15
	saveGlobalStorage = "no"

	-- Spawns
	deSpawnRange = 2
	deSpawnRadius = 50

	-- SqLite
	sqliteDatabase = "forgottenserver.sql"

	-- SQL
	sqlType = "mysql"
	passwordType = "plain"

	-- Startup
	defaultPriority = "high"
	startupDatabaseOptimization = "yes"

	-- Shutdown
	freeMemoryAtShutdown = "yes"

	-- Status
	ownerName = ""
	ownerEmail = "@otland.net"
	url = "http://otland.net/"
	location = "Europe"


The loopback is the only thing I haven't tried or heard of.
My laptop can connect to my PCs internet, just not my OT, if that helps.
 
Last edited by a moderator:
Can people outside of your network connect? if not then the server is not properly forwarded.

If they can then the issue lies with loopback, you can try to connect using the local ip address of the host computer on other pcs on your network to play locally, but this is only if you're having the issue after not being able to connect from a computer outside of your network.
 
Back
Top