Skip to main content

Configuring A Standalone Plugin To Access A MySQL/MariaDB Database

Plugins such as CoreProtect, GadgetsMenu and more ideally should have their information stored in databases as this is far more efficient and less prone to corruption than SQLLite files.

If you have ever seen "Data is malformed" error from a plugin spamming the console (Normally CoreProtect) this means that you didn't safely shutdown the server and corrupted the SQLLite file, and will need to delete it to start again from scratch, possibly losing over 50GB+ worth of /co i history, causing a huge headache for you and your server admins meaning that griefers have the upper hand.


For each plugin, make a different database. Don't merge them together as it makes organisation a headache later on down the line when you want to migrate to a new system and tables are merged. You may also cause conflicts when the table names are the same such as different CoreProtect servers, as the prefix is always co_, so linking your Hub and Survival together would cause data mismatches due to them both using the co_block table.

It is better to organise databases by location, such as:   

  • LuckPerms = Global = Proxy
  • CoreProtect = One Server = Survival

For this example tutorial, we will be using LuckPerms.

Pick a server on your panel and go to the "Databases" tab. Here, in the bottom right corner, you will have "New Database". Click this and name it "luckperms", then click "Create Database".

image.png image.png image.png image.pngimage.png

Go to the File Manager > Plugins > LuckPerms > config.yml. Scroll down and firstly set the server name to what server you are going to be configuring the the plugin on. For example, "Proxy".

image.png

In the storage-method variable, set it to "MariaDB" from H2 to start linking to the database.

image.png

Scroll down a bit more and find the address. Replace with 172.18.0.1 as the IP and some plugins require "3306" as a colon next to the IP, some have a dedicated option for the port such as Port: 3306.

image.png

Right click the tab with "Duplicate" then you will have one tab which has the configuration file open on it, and the other one you can click back to the Databases tab on the panel.

image.png  image.png image.png

Copy the database name by clicking it on the panel, in our case, s2_luckperms, and then putting it into the config. Repeat the same for the username. For the password, click the eye symbol and you will see the password to also put into the config.

image.png image.png

You can now save it with Ctrl + S or the "Save Content" button.

image.png

You can now restart the server and it will link successfully to the database.

image.png