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

MySQL How to Setup a MySQL Database (with photos)

Kedor

New Member
Joined
Mar 3, 2008
Messages
263
Reaction score
0
Location
Poland, Gdynia
ALL CREDITS TO Nikolas and Talaturen
I JUST ADDED PHOTOS TO MAKE IT EASIER FOR GUYS WHO NEED THEM :D

ITS BECAUSE I HAD SOME PROBLEMS LONG TIME AGO WITHOUT PHOTOS
HOPE IT WILL BE USEFULL
HOPE NICOLAS WON'T KILL ME FOR THAT
I ADDED SOME SENTENCES TO BE MORE PRECISE



Welcome.In this thread you will learn how to setup a MySQL Database.

First Step:
1.Download the XAMPP WebServer from Apache Friends



2.Install it (you don't have to change anythink in install windows) and then click twice on icon that appeared on your deskop.

3.Then run both the Apache and MySQL servers.



4.Then go to http://localhost/xampp (if it doesn't work try https://localhost/xampp), chose language and click on Security.



5.Then Click on http://localhost/security/xamppsecurity.php



6.Set up a new password by filling out the two first boxes:

And clicking on password change.

7.Stop both of your servers by clicking on STOP button in XAMPP Control Panel (Apache and MySQL) and then start them again by clicking on START button in XAMPP Control Panel (Like in point 3.).

Second Step:
1.Go to http://localhost/phpmyadmin (or http://localhost/phpmyadmin) and log-in with root as your username and use your newly created password.



2.Create a new database by typing otserv in the box bellow create new database and then clicking on create.



Third Step:
Now you have to import your database file from your OTs folder. In phpMyAdmin on the left side menu choose the otserv database:



And then click in the small SQL button above it:



Click Import Files:


And then browse for the forgottenserver.sql(in case you use the forgotten server) or database.sql or whatever file with sql extend:

And next click ok.



You now have some examples of players, accounts, groups, and some other things working on your database, try browsing the database to see how clear the information is, you are going to realise how easy MySQL is.

If you got some questions about how to edit players (levels, max mana etc) in mysql database.. you can send private message to me.. i will try to explain it :)

Fourth Step:
Go to config.lua and fill up your MySQL part

For all servers except The Forgotten Server
Code:
--- MySQL part (ignore if you are using SQLite)
sql_host = "localhost"
sql_user = "root"
sql_pass = "[COLOR="Red"]your password you created in first step in point 6.[/COLOR]"
sql_db   = "[COLOR="Red"]name of database you created in second step point 2.[/COLOR]"


For the Forgotten Server
Code:
	-- MySQL
	sqlHost = "localhost"
	sqlUser = "root"
	sqlPass = "[COLOR="Red"]your password you created in first step in point 6.[/COLOR]"
	sqlDatabase = "[COLOR="Red"]name of database you created in second step point 2.[/COLOR]"
        mysqlPort = [COLOR="Green"]Leave it as it was[/COLOR]
and
Code:
-- SQL
	sqlType = "mysql"
	passwordType = "plain"


Now when you do what i said carefully you would have a full database ready to use :)
 
Last edited:
this will make it a lot easier for new people starting servers

nice job
 
some help here please i get this error and i changed pass at config.lua i cant understand this.. im new to sql :>
my.php

http://img361.imageshack.us/my.php?image=bugsqlqn5.jpg
 
Remove the whole thing after:
The database.sql of The Forgotten server won't work,what to do?
It is not needed anymore since you get a phpmyadmin version with xampp which supports triggers
 
Erro
consulta SQL:

DELIMITER | CREATE TRIGGER `ondelete_accounts` BEFORE DELETE ON `accounts` FOR EACH ROW BEGIN DELETE FROM `bans` WHERE `account` = OLD.`id` ;



Mensagens do MySQL :

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER |

CREATE TRIGGER `ondelete_accounts`
BEFORE DELETE
ON `accounts`
' at line 1


hhelp pls
 
what exactly do we import?
i cant figure it out...

im trying to use TFS 2.11...I think im missing part of the server, i only downloaded the source and Dll files.

what else do i need?
and what do i need to import?
 
Dont work, i get some error becose of vista that i cant download my sql and apache
 
Wat do i do if it ses your not an gm wen im trying 2 jojn ? mi frends can jojn ther carekters.
 
Oh my god. I've been looking for this for a while.. And finally it's here. It helped me out! Thank you!
 
Heya .
If u help me ith Sql i can make u God.
Sql is ***** hard ! ;s
I need start Eclipse 8.1 server.

Can u help me ?:thumbup:
 
thanks alot this helped me make my first ot best rook wars ;P tyvm
 
Back
Top