Database creation - Dawn-of-Light/DOLSharp GitHub Wiki

The data storage for the DOL server requires a database : the one which will be created is via MariaDB.

win On Windows 10

The first step is to download MariaDB 10.11 Server and to install the program :

mariadb-1

You need to define a password for the admin of the database server :

mariadb-2

[!IMPORTANT] Note this password carefully :)

Once the installation of the server is completed, you should have a new shortcut available for the HeidiSQL tool :

mariadb-3

This tool will be useful for the next steps.

Launch HeidiSQL in order to create a new database for DOL.

Connect to your MariaDB server, via the user "root" and the password defined previously. Please note the type of network must be "MariaDB or MySQL" for this session :

mariadb-4

Once connected, click on your curent session and right-clic to select the menu "Create a new > Database" :

mariadb-5

In the next screen, indicate the database name "dol" with the characterset "ut8_general_ci" and validate :

mariadb-6

That's it, your DOL database has been created !


debian On Linux

The first step is to install MariaDB :

sudo apt update
sudo apt install -y mariadb-server

After the installation, the setup must be completed as below :

sudo mysql_secure_installation

Define the password for the "root" user and reply to Y for each question :

Set root password? [Y/n] Y
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

Edit the configuration file for MariaDB :

sudo vi /etc/mysql/my.cnf

Add the below lines in this file :

[mysqldump]
max_allowed_packet = 200M

[mysql]
default-character-set=utf8

[client]
default-character-set=utf8

[mysqld]
lower_case_table_names=1
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8
max_allowed_packet = 200M

Complete the password setup as below :

mysql -u root -p
use mysql;
alter user 'root'@'localhost' identified via mysql_native_password using password('mypass');
flush privileges;
exit;

Where 'mypass' is the root password

Restart the database server :

sudo systemctl restart mariadb

And check the job is running fine :

sudo systemctl status mariadb

A message should indicate the service is running sucessfully.

Now you can create the "dol" database :

mysql -u root -p
create database dol;
exit;

That's all !


macos On MacOS

Download and install MariaDB via homebrew :

brew install [email protected]
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile
. ~/.bash_profile
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zprofile
. ~/.zprofile

Edit the file "/usr/local/etc/my.cnf" and add the below lines :

[mysqldump]
max_allowed_packet = 200M

[mysql]
default-character-set=utf8

[client]
default-character-set=utf8

[mysqld]
lower_case_table_names=1
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8
max_allowed_packet = 200M

Auto start the service :

brew services start [email protected]

Complete the password setup as below (do not enter any password with first launch of mysql) :

sudo mysql -u root -p
use mysql;
alter user 'root'@'localhost' identified via mysql_native_password;
alter user 'root'@'localhost' identified by 'mypass';
flush privileges;
exit;

Where 'mypass' is your root password

Restart the database server :

brew services restart [email protected] 

Now you can create the "dol" database :

sudo mysql -u root -p
create database dol;
exit;

That's all !