# Database Engine Installation

In 

This is an experimental guide for preparing a Linux server for using it as a database server for ZeeBORN applications. It's basically a document about installing MariaDB and applying the necessary configuration updates for matching the ZeeBORN applications requirements.

# Installation

# 1. Update Linux

Make sure Linux is up-to-date before installing the database engine.

sudo apt-get update
sudo apt-get upgrade

# 2. Install MariaDB

This guide assumes neither MariaDB nor MySQL is installed.

sudo apt-get install mariadb-server mariadb-client

# 3. Configure MariaDB

Perform the initial configuration by performing the following command.

sudo mysql_secure_installation

Set password for user root to ###### and enable remote access for root when asked.

# 4. Create Application Accounts

The ZeeBORN software expects two pre-configured user accounts that can be used for administrative tasks and for general application operation.

sudo mysql -u root -p
GRANT ALL PRIVILEGES ON *.* TO '######'@'%' IDENTIFIED BY '######' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO '######'@'%' IDENTIFIED BY '######' WITH GRANT OPTION;
FLUSH PRIVILEGES;
quit;

# 5. Update Configuration

The following changes must be applied to file /etc/mysql/my.cnf. Use nano, pico or any other usable text editor for updating the configuation file (e.g. sudo nano my.cnf).

The default port used by MariaDB/MySQL is 3306. If you prefer to use another port, you will also need to manually need to change the port value while installing the database and the client software.

[client-server]
port=3306

The following changes must be applied to file (/etc/mysql/mariadb.conf.d/50-server.cnf). Those values may already exist and need to be updated or need to be added if missing.

[mysqld]
bind-address=0.0.0.0
lower_case_table_names=1
max_allowed_packet=250M
innodb_log_file_size=250M
table_open_cache=4000
table_definition_cache=4000
collation_server=utf8mb4_general_ci
character_set_server=utf8mb4
net_buffer_length=1048576

# 6. Restart MariaDB

sudo service mariadb restart

# Uninstall MariaDB

sudo apt-get remove --purge mariadb*
sudo apt-get autoremove
sudo apt-get autoclean