How to compile server and set it up with MySQL (Mariadb) on Linux
- Ryozuki
- Posts: 1748
- Joined: Tue Feb 24, 2015 7:28 am
- Location: Catalonia
- Player profile: http://ddnet.tw/players/Ryozuki/
- Mapper profile: http://ddnet.tw/mappers/Ryozuki/
- Clan: Unique
- Website: https://edgarluque.com
- Discord: Ryozuki#2188
How to compile server and set it up with MySQL (Mariadb) on Linux
How to compile server and set it up with MySQL on Linux
written by Ryozuki, slightly edited by Index
VIDEO
Video not updated to current version
COMPILE SERVER
Install packgages with this command:
ESTABLISH A SERVER WITH MYSQL (Mariadb)
FIrst of all you have to install mySQL and run it. I recommend to press y(es) to all.
Note: In this tutorial we use mariadb, a open-source driven version of mysql with more features and better perfomence. (It's fully compatible with mysql)
Run
On your server config enable mysql and make it load the config:
What this does?
You need the 2 entries, notice the "w" and the "r", one reads and the other writes to the database.
The prefix is a name prepended to the generated tables (recommended to use "record", it will the generate tables called record_race, record_teamrace, record_points, etc)
Compile the server:
Install screen, so you can run the server after you close the shell.
Then you detach it with control+a then control+d
written by Ryozuki, slightly edited by Index
VIDEO
Video not updated to current version
SpoilerShow
[bbvideo=640,360]https://www.youtube.com/watch?v=xcRvXsfXb9A[/bbvideo]
Install packgages with this command:
sudo apt-get install bam libsdl2-dev libfreetype6-dev libcurl4-openssl-dev libogg-dev libopus-dev libopusfile-dev
apt-get install unzip
wget https://github.com/ddnet/ddnet/archive/master.zip
unzip master.zip
cd ddnet-master
ESTABLISH A SERVER WITH MYSQL (Mariadb)
FIrst of all you have to install mySQL and run it. I recommend to press y(es) to all.
Note: In this tutorial we use mariadb, a open-source driven version of mysql with more features and better perfomence. (It's fully compatible with mysql)
sudo apt-get install libmariadbclient-dev libmysqlcppconn-dev libboost-dev mariadb-server
Run
mysql_secure_installation
and follow the steps, note: it's recommended to set a root password.On your server config enable mysql and make it load the config:
nano autoexec_server.cfg
sv_use_sql 1
add_sqlserver r database_name "prefix" "user" "password" "localhost" "3306" 1
add_sqlserver w database_name "prefix" "user" "password" "localhost" "3306" 1
What this does?
You need the 2 entries, notice the "w" and the "r", one reads and the other writes to the database.
The prefix is a name prepended to the generated tables (recommended to use "record", it will the generate tables called record_race, record_teamrace, record_points, etc)
- "database_name" is the name of the database, i usually use "teeworlds" or "ddnet"
- The number 3306 is the default mariadb and mysql port.
- The number 1 at the end means "enabled"
- "localhost" is the ip, only change if you have strong reasons, or want to connect to a db on another sv.
bam config mysql.use_mysqlconfig=true
Compile the server:
bam server_sql_release
Install screen, so you can run the server after you close the shell.
sudo apt-get install screen
screen ./DDNet-Server_sql -f autoexec_server.cfg
Then you detach it with control+a then control+d
Last update: 16-05-2017
- deen
- Posts: 3576
- Joined: Mon May 05, 2014 2:30 pm
- Player profile: https://ddnet.org/players/deen/
- Discord: deen#5910
Re: How to compile client and set-up server on Linux
In the last line that should be DDNet-Server_sql I believe.
- Amulus
- Posts: 40
- Joined: Sat Dec 13, 2014 4:31 pm
- Player profile: http://ddnet.tw/players/Amu~Cookie/
- Clan: BioPi
- YouTube: user/MrAmulus
Re: How to compile client and set-up server on Linux
Thank you for the tuto .
I got an error tho : [16-01-04 14:16:54][console]: failed to open 'maps/Kobra 4.map.cfg'
But the server seem working i'm connected to it
I got an error tho : [16-01-04 14:16:54][console]: failed to open 'maps/Kobra 4.map.cfg'
But the server seem working i'm connected to it
Take this COOKIE
- deen
- Posts: 3576
- Joined: Mon May 05, 2014 2:30 pm
- Player profile: https://ddnet.org/players/deen/
- Discord: deen#5910
Re: How to compile client and set-up server on Linux
That's not an error. It just checks whether this config file exists, if it doesn't then that's fine.
- Ryozuki
- Posts: 1748
- Joined: Tue Feb 24, 2015 7:28 am
- Location: Catalonia
- Player profile: http://ddnet.tw/players/Ryozuki/
- Mapper profile: http://ddnet.tw/mappers/Ryozuki/
- Clan: Unique
- Website: https://edgarluque.com
- Discord: Ryozuki#2188
Re: How to compile server and set it up with mySQL on Linux
I reworked the tutorial a bit and soon i'll add a video.
-
- Posts: 400
- Joined: Sat Apr 11, 2015 5:05 pm
- Player profile: http://ddnet.tw/players/Chairn/
- Clan: QuintessenZ
Re: How to compile server and set it up with MySQL on Linux
Please add date on your first post so that people know that it is up to date.
- Ryozuki
- Posts: 1748
- Joined: Tue Feb 24, 2015 7:28 am
- Location: Catalonia
- Player profile: http://ddnet.tw/players/Ryozuki/
- Mapper profile: http://ddnet.tw/mappers/Ryozuki/
- Clan: Unique
- Website: https://edgarluque.com
- Discord: Ryozuki#2188
Re: How to compile server and set it up with MySQL on Linux
What you mean? If you mean the source, on the tutorial post is allways up to date cuz u download master branch. On the vid i downloaded the 10.1 because idk xDChairn wrote:Please add date on your first post so that people know that it is up to date.
-
- Posts: 400
- Joined: Sat Apr 11, 2015 5:05 pm
- Player profile: http://ddnet.tw/players/Chairn/
- Clan: QuintessenZ
Re: How to compile server and set it up with MySQL on Linux
Just add:
Last edited on 14/06/16.
Last edited on 14/06/16.
Who is online
Users browsing this forum: No registered users and 5 guests