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

Windows Server Help!

SnorkY

Veteran OT User
Joined
Nov 28, 2007
Messages
1,395
Reaction score
264
Hello, i changed from an old version of Avesta to Avesta v4.

I get this error :

"Error: Failed to connect to database"

Code:
	-- Avesta

	-- Connection
	-- NOTE: defaultPriority works only on Windows
	ip = "MYIP"
	port = "7171"
	loginTries = 10
	retryTimeout = 5000
	loginTimeout = 60 * 1000
	allowClones = 0
	checkAccounts = true
	motd = "Welcome to Avesta!"
    	loginMessage = "Welcome to Avesta!"
	serverName = "Avesta"
    	worldName = "Avesta"
	maxPlayers = "1000"

	-- Database
	sqlType = "mysql"
	sqlDatabaseName = "otserv2"
    	sqlHost = "localhost"
    	sqlPort = 3306
    	sqlUser = "root"
    	sqlPass = ""
	passwordType = "plain"
    	storePlayerDeathsInDB = false

	-- Global save
	-- NOTE: globalSaveHour means like 08:00, not that it will save every 8 hours
	-- may be unstable, we recommend using OTAdmin if you want real saves.
	-- NOTE: If you set autoSaveEachMinutes = 0, ausave but disabled 
	globalSaveEnabled = false
	globalSaveHour = 8
	shutdownAtGlobalSave = false
	autoSaveEachMinutes = 1

	-- Unjustified kills
    	timeToDecreaseFrags = 24 * 60 * 60 * 1000
    	whiteSkullTime = 15
	killsToRedSkull = 3

	-- Banishments
    	notationsToBan = 3
	warningsToFinalBan = 4
	warningsToDeletion = 5
	banLength = 1 * 24 * 60 * 60
	finalBanLength = 7 * 24 * 60 * 60
	ipBanishmentLength = 24 * 60 * 60
	killsToBan = 7

	-- Battle
	worldType = "pvp"
	exhausted = 1000
	fightExhausted = 2000
    	healExhausted = 1000
    	exhaustedAdd = 200
    	pzLock = 60000
    	fieldOwnershipDuration = 5000
    	removeAmmunition = false
    	removeRuneCharges = false
    	removeWeaponCharges = true
	playersCannotChangeOutfit = false
	useCapSystem = true
	deathLosePercent = 10
	showAnnimationLevelSkill = false

	-- Change sex
	changeSexPrice = 10000
	changeSexOnlyPremium = true

	-- Map
    	dataDirectory = "data/"
    	map = "data/world/world2.otbm"
    	mapKind = "OTBM"
    	mapStoreType = "relational"
	randomizeTiles = true

	-- Clean
	cleanMapAtGlobalSave = true

	-- Houses
    	houseRentPeriod = "monthly"
	housePriceEachSqm = 1000
	levelToBuyHouse = 8
	housesOnlyPremiumAccounts = true
    	bedsOnlyPremiumAccount = true

	-- Item usage
    	minActionInterval = 200
    	minActionExInterval = 1000

	-- Premium account
	freePremium = false

	-- Rates
    	rateExp = 9999
    	rateSkill = 10
    	rateMagic = 10
    	rateLoot = 10

	-- Spawns
    	rateSpawn = 1
    	spawnRange = 2
    	spawnRadius = 50

	-- Others
    	maxMessageBuffer = 4
    	saveClientDebug = false
    	useAccBalance = false
	maxIdleTime = 15
   
	-- Rook system
    	levelToRook = 5
    	rookTempleId = 1

	-- Status
    	ownerName = "Tryller"
    	ownerEmail = "@youremailhere"
    	url = "http://yourwebsitehere.com/"
    	location = "Brazil"

What do i need to change to make the server work?

Thanks.
 
PHP:
sqlType = "mysql" -- Mysql or sqlite what you are using
sqlDatabaseName = "otserv2" -- Name of database
sqlHost = "localhost"
sqlPort = 3306
sqlUser = "root"
sqlPass = "" -- pass to xampp/mysql
 
sqlType = "mysql" -- Mysql or sqlite what you are using
sqlDatabaseName = "avesta -- Name of database (since im using avesta server?)
sqlHost = "localhost"
sqlPort = 3306
sqlUser = "root"
sqlPass = "" -- pass to xampp/mysql (no password since i dont have a xxampp/mysql downloaded?)
 
Install xampplite and enter "localhost/security"
Then set your password. Do not forget it! You may write it in the config right away.

Code:
SqlDatabaseName = "--database--"
You will have to create a database when you've signed in to phpmyadmin.
Then set the database name you just created in to that field. :D
 
Back
Top