DevelopersMySQL databases

Use a MySQL database with your server

Many plugins and mods can keep their data in a MySQL database instead of local files: permissions (LuckPerms), block logs (CoreProtect), economy, bans and stats. Every Hostwolf server includes up to 5 MySQL-compatible databases (MariaDB) at no extra cost.

Your databases run on your own server's machine, not on a shared database server, so they are fast and nobody else's load slows them down. It also means that deleting the server deletes its databases. Download a copy first if you want to keep them.

Create a database#

  1. Open your server in the control panel and go to the Databases tab.
  2. Click New database and give it a short name, for example luckperms.
  3. Click Create database.

The first database on a server also starts the database service, which takes about a minute. The tab shows a progress note and the database appears by itself. Later databases are created at once.

Click the eye icon next to a database to see its connection details. Every value has a copy button, and the password stays hidden until you click Show.

FieldValue
Host172.18.0.1 (the address your game server uses to reach the database)
Port3306
Databasethe name shown in the tab, for example s12_luckperms
Username and passwordshown in the connection details

Use 172.18.0.1 as the host in plugin configs, not localhost or 127.0.0.1. Your game server runs in its own container, so localhost points at the container itself.

LuckPerms#

Stop the server, then edit plugins/LuckPerms/config.yml in the Files tab:

storage-method: MySQL

data:
  address: 172.18.0.1:3306
  database: s12_luckperms
  username: u12_AbCdEfGhIj
  password: 'your-password'

Start the server. The console shows Loading storage provider... [MYSQL] and LuckPerms creates its tables. To share ranks across a BungeeCord or Velocity network, point every server at the same database (see Share a database with your other servers) and give each one a different server: name if you use per-server permissions.

CoreProtect#

Edit plugins/CoreProtect/config.yml:

use-mysql: true
table-prefix: co_
mysql-host: 172.18.0.1
mysql-port: 3306
mysql-database: s12_coreprotect
mysql-username: u12_KlMnOpQrSt
mysql-password: your-password

Restart the server. CoreProtect logs a lot of data, so give it its own database rather than sharing one with other plugins.

Other plugins and mods#

Most plugins ask for the same five values: host, port, database, username and password. Java plugins that want a single JDBC URL can use the JDBC connection string from the connection details, for example jdbc:mysql://172.18.0.1:3306/s12_luckperms, with the username and password entered separately.

Share a database with your other servers#

Remote access is off by default: only game servers on the same machine can connect. To let your other Hostwolf servers or a website use a database:

  1. Open the database's connection details.
  2. Under Remote access, click your other servers in the list, or type the public IPv4 address of another server or website.
  3. Click Save remote access.

The firewall then opens the database port to exactly those addresses. They connect with the Host (from outside) address shown in the connection details, port 3306, and the same username and password.

Connect from HeidiSQL, DBeaver or MySQL Workbench#

Desktop apps are handy for browsing tables, running queries and importing large files.

  1. Find your computer's public IP (search "what is my IP"). In the database's connection details, add it under Remote access, or tick Allow connections from anywhere if your home IP changes often.
  2. In your app, create a new MySQL or MariaDB connection.
  3. Enter the Host (from outside) address, port 3306, and the username and password from the connection details.

In HeidiSQL choose MariaDB or MySQL (TCP/IP) as the network type. In DBeaver choose MariaDB (or MySQL) and let it download the driver when it asks.

Allow connections from anywhere lets anyone on the internet try to log in, so only the long random password protects your data. Keep it private, click Rotate Password if it may have leaked, and turn the option off when you are done.

Export, import and backups#

  • Download: the connection details have a Download button that saves the database as a .sql.gz file.
  • Import: Import a file loads a .sql or .sql.gz file of up to 50 MB. For bigger files, use a desktop app.
  • Backups: your databases are included in your server's backups automatically. Restoring a backup in the Backups tab brings the databases back to the same point in time. The dumps are kept in the hostwolf-databases folder of your server's files.

From code or an AI assistant#

The SDK, the MCP server and the REST API can create databases, change remote access, rotate passwords and export or import them. Ask your assistant, for example: "Create a database called luckperms on my survival server and set up LuckPerms to use it."

Troubleshooting#

  • Communications link failure or connection refused: check the host is 172.18.0.1 and the port is 3306. From outside, use the Host (from outside) address and make sure your IP is allowed under Remote access.
  • Access denied: copy the password again from the connection details. After Rotate Password, update every plugin that uses the database.
  • The tab says the database service isn't answering: your data is safe. Check that the server's machine is online and try again in a few minutes, or contact support.
  • You need more than 5 databases: contact support.
Stuck, or missing an endpoint? Tell us at game.hostwolf.net/contact or support@hostwolf.net.