Configuring MariaDB (or MySql)

First we force the codepage UTF8 as internal data format to avoid eventual codepage conflicts.

vi /etc/mysql/my.cnf

In the sections [client], [mysql] and [mysqld] we add the following lines. Missing sections we add completely, of course without the “…”:

init-connect='SET NAMES utf8mb4'

For the first database configuration run the following install script:

The script asks several questions – answers are shown in bold:

1) (Enter) – Please enter the root password. Leave empty upon initial installation (press Enter).

2) n – no: Introduced with MySql 5.7 the SQL root account can be called only by the Linux root account. There is no need to switch to “unix_socket authentication”.

3) n – no: Introduced with MySql 5.7 the SQL root account can be called only by the Linux root account. This one has always access without typing any password. For this reason a SQL root password is no longer necessary.

4) Y – Delete the anonymous user: Yes! This has been created for test purposes only and is not used for productive operation. Using the anonymous user, anyone could access the database server without a valid login account.

5) Y – Deny remote root logins! Access to the database always takes place locally. Connection to the internet is not managed by the database but by the corresponding application process (OpenSim or SSH).

6) Y – Remove the test database.

7) Y – Reload the privilege tables to make changes effective immediately.

Tipps: The Sql Server starts up during system boot. Use these commands for manual starting, stopping and status query.
– Start the service: „service mysql start“
– Stop the service: „service mysql stop“
– Query the status of the service: „service mysql status“

Now you can create a new database “opensim” and a user “opensim” with limited privileges. (You can choose the names according to your likings but they will be referred to as “opensim” furtheron in this tutorial.) The necessary commands are shown in bold in the following screenshot:

mysql -u root
Welcome to the MariaDB monitor ...

MariaDB [(none)]> create database opensim character set 'utf8';
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> create user opensim identified by 'MyOpensimPassword';
Query OK, 0 row affected (0.00 sec)

MariaDB [(none)]> grant all privileges on opensim.* to opensim;
Query OK, 0 row affected (0.00 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 row affected (0.00 sec)

MariaDB [(none)]> quit;

Continued: Online updates

Scroll to Top