How to compile server and set it up with MySQL (Mariadb) on Linux
Posted: Sun Nov 15, 2015 6:11 pm
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