Difference between revisions of "MariaDB"

From Onset Developer Wiki
 
Line 4: Line 4:
 
[[File:mariadb_installation.JPG]]
 
[[File:mariadb_installation.JPG]]
 
===Windows===
 
===Windows===
Make sure to have the file ''libmariadb.dll'' in the same directory as ''HorizonServer.exe''.
+
Make sure to have the file ''libmariadb.dll'' in the same directory as ''OnsetServer.exe''.
 
You can find that file in the Server folder delivered with the game.
 
You can find that file in the Server folder delivered with the game.
  

Latest revision as of 16:15, 28 November 2019

Installation

Open the server_config.json file and add mariadb to the plugins.

mariadb installation.JPG

Windows

Make sure to have the file libmariadb.dll in the same directory as OnsetServer.exe. You can find that file in the Server folder delivered with the game.

The MariaDB plugin can connect to MySQL 5.x and MariaDB 10.x servers. But it can not connect to MySQL 8.x servers.

Linux

Install the following package on the target system.

apt-get install libmariadbclient-dev

Compiling from source

Minimum requirements

Windows

Download the MariaDB C/C++ Connector from https://mariadb.com/downloads/#connectors

git clone https://github.com/BlueMountainsIO/PluginMariaDB.git
cd PluginMariaDB
cmake -DMARIADBCAPI_INCLUDE_DIR="C:\Program Files\MariaDB\MariaDB Connector C 64-bit\include" -DBOOST_ROOT="D:\Lib\boost_1_71_0" -DCMAKE_GENERATOR_PLATFORM=x64 .

Open the generated mariadb.sln file and select "Release" as build target. Right click on the solution and hit rebuild.

BuildMariaDBPluginWindows.png

The .dll will be under PluginMariaDB\src\Release.

Ubuntu

apt-get install libmariadbclient-dev
git clone https://github.com/BlueMountainsIO/PluginMariaDB.git
cd PluginMariaDB
cmake -DMARIADBCAPI_INCLUDE_DIR=/usr/include/mysql -DMARIADBCAPI_LIBRARY=/usr/lib/x86_64-linux-gnu/libmariadbclient.so -DBOOST_ROOT=/usr/include/boost_1_71_0 -DBUILD_STATIC=OFF .
make

For static builds you can do:

cmake -DMARIADBCAPI_INCLUDE_DIR=/usr/include/mysql -DMARIADBCAPI_LIBRARY_STATIC=/usr/lib/x86_64-linux-gnu/libmariadbclient_r.a -DBOOST_ROOT=/usr/include/boost_1_71_0 -DBUILD_STATIC=ON .

The reason why we use libmariadbclient-dev over libmariadb-dev is because the latter does have a wrong hardcoded path for the mysql.sock file.