MariaDB: Difference between revisions
No edit summary |
No edit summary |
||
(15 intermediate revisions by 2 users not shown) | |||
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 '' | 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. | ||
===Linux=== | 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 (Ubuntu)=== | |||
Install the following package on the target system. | Install the following package on the target system. | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
apt-get install libmariadbclient- | apt-get install libmariadb-dev | ||
</syntaxhighlight> | |||
====Ubuntu 19 & Ubuntu 20 Notice==== | |||
On Ubuntu 19/20 you might need to create a link to the correct libmariadbclient. | |||
<syntaxhighlight lang="bash"> | |||
cd /usr/lib/x86_64-linux-gnu | |||
sudo ln -s libmariadbclient.so libmariadbclient.so.18 | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==Compiling from source== | ==Compiling from source== | ||
Recommended requirements | |||
* CMake 3.1 (https://cmake.org) | * CMake > 3.1 (https://cmake.org) | ||
* Boost 1. | * Boost 1.81.0 (https://boost.org) | ||
* Visual Studio | * Visual Studio 2022 (Windows) or GCC 11 (Linux) | ||
===Windows=== | ===Windows=== | ||
Download the MariaDB C/C++ Connector from https://mariadb.com/downloads/#connectors | Download the MariaDB C/C++ Connector 64bit for Windows from https://mariadb.com/downloads/#connectors | ||
Download boost and extract it. | |||
<syntaxhighlight lang="batch"> | <syntaxhighlight lang="batch"> | ||
git clone https://github.com/BlueMountainsIO/PluginMariaDB.git | git clone https://github.com/BlueMountainsIO/PluginMariaDB.git | ||
cd PluginMariaDB | cd PluginMariaDB | ||
cmake -DMARIADBCAPI_INCLUDE_DIR="C:\Program Files\MariaDB\MariaDB Connector C 64-bit\include" -DBOOST_ROOT="D:\Lib\ | cmake -DMARIADBCAPI_INCLUDE_DIR="C:\Program Files\MariaDB\MariaDB Connector C 64-bit\include" -DBOOST_ROOT="D:\Lib\boost_1_81_0" -DCMAKE_GENERATOR_PLATFORM=x64 . | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 30: | Line 40: | ||
Right click on the solution and hit rebuild. | Right click on the solution and hit rebuild. | ||
[[File: | [[File:BuildMariaDBPluginWindowsVS2022.png]] | ||
The .dll will be under ''PluginMariaDB\src\Release''. | The .dll will be under ''PluginMariaDB\src\Release''. | ||
Line 36: | Line 46: | ||
===Ubuntu=== | ===Ubuntu=== | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
apt-get install | apt-get install libmariadb-dev | ||
git clone https://github.com/BlueMountainsIO/PluginMariaDB.git | git clone https://github.com/BlueMountainsIO/PluginMariaDB.git | ||
cd PluginMariaDB | cd PluginMariaDB | ||
cmake -DMARIADBCAPI_INCLUDE_DIR=/usr/include/ | cmake -DMARIADBCAPI_INCLUDE_DIR=/usr/include/mariadb -DMARIADBCAPI_LIBRARY=/usr/lib/x86_64-linux-gnu/libmariadbclient.so -DBOOST_ROOT=/usr/include/boost_1_81_0 -DBUILD_STATIC=OFF . | ||
make | make | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 45: | Line 55: | ||
For static builds you can do: | For static builds you can do: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
cmake -DMARIADBCAPI_INCLUDE_DIR=/usr/include/ | cmake -DMARIADBCAPI_INCLUDE_DIR=/usr/include/mariadb -DMARIADBCAPI_LIBRARY=/usr/lib/x86_64-linux-gnu/libmariadbclient.a -DBOOST_ROOT=/usr/include/boost_1_81_0 -DBUILD_STATIC=ON . | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Latest revision as of 14:06, 19 December 2022
Installation
Open the server_config.json file and add mariadb to the plugins.
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 (Ubuntu)
Install the following package on the target system.
apt-get install libmariadb-dev
Ubuntu 19 & Ubuntu 20 Notice
On Ubuntu 19/20 you might need to create a link to the correct libmariadbclient.
cd /usr/lib/x86_64-linux-gnu
sudo ln -s libmariadbclient.so libmariadbclient.so.18
Compiling from source
Recommended requirements
- CMake > 3.1 (https://cmake.org)
- Boost 1.81.0 (https://boost.org)
- Visual Studio 2022 (Windows) or GCC 11 (Linux)
Windows
Download the MariaDB C/C++ Connector 64bit for Windows from https://mariadb.com/downloads/#connectors Download boost and extract it.
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_81_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.
The .dll will be under PluginMariaDB\src\Release.
Ubuntu
apt-get install libmariadb-dev
git clone https://github.com/BlueMountainsIO/PluginMariaDB.git
cd PluginMariaDB
cmake -DMARIADBCAPI_INCLUDE_DIR=/usr/include/mariadb -DMARIADBCAPI_LIBRARY=/usr/lib/x86_64-linux-gnu/libmariadbclient.so -DBOOST_ROOT=/usr/include/boost_1_81_0 -DBUILD_STATIC=OFF .
make
For static builds you can do:
cmake -DMARIADBCAPI_INCLUDE_DIR=/usr/include/mariadb -DMARIADBCAPI_LIBRARY=/usr/lib/x86_64-linux-gnu/libmariadbclient.a -DBOOST_ROOT=/usr/include/boost_1_81_0 -DBUILD_STATIC=ON .