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 “…”:

[client]
...
default-character-set=utf8mb4
...
[mysql]
...
default-character-set=utf8mb4
...
[mysqld]
...
collation-server=utf8mb4_unicode_ci
init-connect='SET NAMES utf8mb4'
character-set-server=utf8mb4
...

Then we have to activate the MySql server MariaDB. This time we start it by hand, because otherwise the service would not be started until the next system startup.

systemctl enable mysql.service
systemctl start mysql.service

For the first database configuration run the following install script:
/usr/bin/mysql_secure_installation

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. This one has always access without typing any password. For this reason a SQL root password is no longer necessary.

3) 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.

4) 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).

5) Y – Remove the test database.

6) 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;
Bye

Continued: Online updates

Scroll to Top