Installation et configuration de MySQL pour OpenSimulator

Distribution de travail : Lubuntu 24.04

Documentation : https://docs.vultr.com/how-to-install-mysql-on-ubuntu-24-04

1/ Installation de MySql :

util01@station54:~$ sudo apt install mysql-server -y

2/ Vérification de la version :

util01@station54:~$ mysql --version
mysql  Ver 8.0.41-0ubuntu0.24.04.1 for Linux on x86_64 ((Ubuntu))
util01@station54:~$ 

3/ Activation du serveur MySQL au démarrage :

util01@station54:~$ sudo systemctl enable mysql
Synchronizing state of mysql.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable mysql
util01@station54:~$ 
4/ Lancement du serveur :
util01@station54:~$ sudo systemctl start mysql

5/ Vérification :

util01@station54:~$ sudo systemctl status mysql
● mysql.service - MySQL Community Server
     Loaded: loaded (/usr/lib/systemd/system/mysql.service; enabled; preset: enabled)
     Active: active (running) since Mon 2025-02-03 08:23:44 CET; 4min 1s ago
   Main PID: 4576 (mysqld)
     Status: "Server is operational"
      Tasks: 37 (limit: 9373)
     Memory: 351.9M (peak: 379.1M)
        CPU: 2.852s
     CGroup: /system.slice/mysql.service
             └─4576 /usr/sbin/mysqld

févr. 03 08:23:29 station54 systemd[1]: Starting mysql.service - MySQL Community Server...
févr. 03 08:23:44 station54 systemd[1]: Started mysql.service - MySQL Community Server.
util01@station54:~$ 

6/ Sécurisation :

util01@station54:~$ sudo mysql_secure_installation

Securing the MySQL server deployment.
...
VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?

Press y|Y for Yes, any other key for No: y

There are three levels of password validation policy:
...
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.
...
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.
...
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
 - Dropping test database...
Success.
...
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.

All done! 
util01@station54:~$ 

7/ Redémarrer le serveur :

util01@station54:~$ sudo systemctl stop mysql
util01@station54:~$ sudo systemctl start mysql
util01@station54:~$ sudo systemctl status mysql

8/ Changer le mot de passe 'root' :

util01@station54:~$ sudo mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.41-0ubuntu0.24.04.1 (Ubuntu)

Copyright (c) 2000, 2025, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'M0t2pa$$e1973';
Query OK, 0 rows affected (1,01 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0,14 sec)

mysql> 
mysql> exit
Bye
util01@station54:~$ 

9/ Redémarrer le serveur MySQL :

util01@station54:~$ sudo systemctl restart mysql

10/ Test :

util01@station54:~$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.41-0ubuntu0.24.04.1 (Ubuntu)
...
mysql> 

11/ Création de la base de données 'opensim' et de son utilisateur 'opensim'.

util01@station54:~/JEUX/SECONDLIFE/opensim/bin$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.41-0ubuntu0.24.04.1 (Ubuntu)

Copyright (c) 2000, 2025, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE opensim;
Query OK, 1 row affected (2,86 sec)

mysql> CREATE USER 'opensim'@'localhost' IDENTIFIED BY 'M0t2Pa$$e';
Query OK, 0 rows affected (5,30 sec)

mysql> GRANT ALL PRIVILEGES ON opensim.* TO 'opensim'@'localhost';
Query OK, 0 rows affected (0,77 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0,47 sec)

mysql> exit
Bye
util01@station54:~/JEUX/SECONDLIFE/opensim/bin$ 

12/ Configuration.

  • Copie du fichier de configuration :
util01@station54:~/JEUX/SECONDLIFE/opensim/bin$ cp OpenSim.ini.example OpenSim.ini
util01@station54:~/JEUX/SECONDLIFE/opensim/bin$ cd config-include/
util01@station54:~/JEUX/SECONDLIFE/opensim/bin/config-include$ 
  • Copie du fichier de configuration :
util01@station54:~/JEUX/SECONDLIFE/opensim/bin/config-include$ cp StandaloneCommon.ini.example StandaloneCommon.ini
util01@station54:~/JEUX/SECONDLIFE/opensim/bin/config-include$ cp  FlotsamCache.ini.example FlotsamCache.ini
  • Configuration Mysql :

Ouvrir :

StandaloneCommon.ini

Chercher :

Include-Storage = "config-include/storage/SQLiteStandalone.ini";

Remplacer par :

;Include-Storage = "config-include/storage/SQLiteStandalone.ini";

Chercher :

    ;StorageProvider = "OpenSim.Data.MySQL.dll"
    ;ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;SslMode=None;"

Remplacer par :

    StorageProvider = "OpenSim.Data.MySQL.dll"
    ConnectionString = "Data Source=localhost;Database=opensim;User ID=root;Password=M0t2pa$$e1973;Old Guids=true;SslMode=None;"
util01@station54:~/JEUX/SECONDLIFE/opensim/bin/config-include$ cd ..
util01@station54:~/JEUX/SECONDLIFE/opensim/bin$ 

13/ Premier lancement de OpenSim.

util01@station54:~/JEUX/SECONDLIFE/opensim/bin$ dotnet OpenSim.dll
20:39:30 - [OPENSIM MAIN]: configured log4net using default OpenSim.exe.config
20:39:30 - [UTIL] TimeStamp clock with period of 1E-06ms
20:39:30 - [OPENSIM MAIN]: System Locale is en-US
20:39:30 - [OPENSIM MAIN]: Environment variable MONO_THREADS_PER_CPU is unset
20:39:30 - [OPENSIM MAIN]: Runtime gave us 4 min worker threads and 1 min IOCP threads
20:39:30 - [OPENSIM MAIN]: Runtime gave us 32767 max worker threads and 1000 max IOCP threads
20:39:30 - [OPENSIM MAIN]: Limiting max worker threads to 1000
20:39:30 - [OPENSIM MAIN]: Threadpool set to 1000 max worker threads and 1000 max IOCP threads
20:39:30 - [OPENSIM MAIN]: Environment is supported by OpenSimulator.
20:39:30 - Default culture changed to anglais (États-Unis)
20:39:30 - [CONFIG]: Reading configuration settings
20:39:30 - [CONFIG]: Reading configuration file /home/util01/JEUX/SECONDLIFE/opensim/bin/OpenSimDefaults.ini
20:39:30 - [CONFIG]: Reading configuration file /home/util01/JEUX/SECONDLIFE/opensim/bin/OpenSim.ini
...
New region name []: region0000
RegionUUID [8efe01ea-f8ef-4529-8d06-bea87d6247c6]: 
Region Location [1000,1000]: 
Internal IP address [0.0.0.0]: 
Internal port [9000]: 
Resolve hostname to IP on start (for running inside Docker) [False]: 
External host name [SYSTEMIP]: 
20:43:07 - [REGIONINFO]: Resolving SYSTEMIP to 192.168.1.17 for external hostname of region region0000
...
20:43:07 - [ESTATE]: No existing estates found.  You must create a new one.
New estate name [My Estate]: region0000
20:43:12 - [SCENE]: Default script engine YEngine
...
20:43:15 - [SCENE]: Secure permissions loading enabled, modules loaded: DefaultPermissionsModule
Estate region0000 has no owner set.
Estate owner first name [Test]: Solomon
Estate owner last name [User]: Kane
Password: 
Email: solomon.kane@gmail.com
User ID [a61712a1-9380-4f2e-a105-77b3f2db08a8]: 
20:44:21 - [AUTHENTICATION DB]: Set password for principalID a61712a1-9380-4f2e-a105-77b3f2db08a8
20:44:34 - [RADMIN]: No default avatar information available
20:44:34 - [RADMIN]: Default avatars not loaded
Currently selected region is region0000
Region (region0000) #