Databases

How to create and manage MySQL databases for your game server on Witchly.host — connection strings, common uses, and troubleshooting.

Databases

Some game server plugins and mods require a database to store persistent data — player statistics, economy balances, permissions, land claims, and more. Witchly.host provides MySQL databases that you can create and manage directly from the control panel.

What Databases Are Used For

Databases are most commonly used by:

  • Permission plugins (e.g., LuckPerms) — Store player ranks, permissions, and group data
  • Economy plugins (e.g., EssentialsX, Vault-compatible plugins) — Track player balances and transaction history
  • Land/claim plugins (e.g., GriefPrevention, Towny) — Store claim boundaries, ownership, and settings
  • Statistics and leaderboards — Track kills, deaths, playtime, and other metrics
  • Cross-server synchronization — Share data between multiple servers (e.g., a network with lobby, survival, and minigames)
  • Web integrations — Display server data on a website (e.g., Dynmap, server stats pages)

Not every server needs a database. If your plugins and mods work fine without one, there is no need to create one. Many plugins default to flat-file storage (YAML, JSON, or SQLite) which works perfectly for single-server setups.

Creating a Database

  1. Log in to Dashboard and select your server
  2. Click Databases in the sidebar
  3. Click New Database
  4. Enter a name for the database — use something descriptive that identifies its purpose (e.g., luckperms, economy, towny)
  5. The Connections From field controls which hosts can connect. Leave it as % to allow connections from your server (this is the default and correct for most use cases)
  6. Click Create Database

Your database will be created instantly. The panel will display the connection details you need.

Connection Details

After creating a database, you will see the following information in the panel:

  • Host — The database server address (e.g., 127.0.0.1 or the host address shown in the panel)
  • Port — The MySQL port (typically 3306)
  • Database Name — The name you chose, prefixed with your server identifier
  • Username — Automatically generated
  • Password — Click the eye icon to reveal the password

These details are what you enter into your plugin’s configuration file. The exact field names vary by plugin, but they all need the same basic information.

Configuring Plugins to Use Your Database

Each plugin has its own configuration file where you enter database connection details. Here are examples for popular plugins:

LuckPerms

In plugins/LuckPerms/config.yml:

storage-method: MySQL

data:
  address: "HOST:PORT"
  database: "DATABASE_NAME"
  username: "USERNAME"
  password: "PASSWORD"

Replace HOST, PORT, DATABASE_NAME, USERNAME, and PASSWORD with the values from your panel.

EssentialsX

In plugins/Essentials/config.yml, look for the storage section and configure the MySQL connection details as specified in the EssentialsX documentation. Not all versions of EssentialsX support MySQL — check your version’s documentation.

General Plugin Pattern

Most plugins follow a similar pattern in their config files:

database:
  type: mysql
  host: "HOST"
  port: PORT
  name: "DATABASE_NAME"
  user: "USERNAME"
  password: "PASSWORD"

Always refer to the specific plugin’s documentation for the exact field names and format.

Managing Your Databases

Viewing Databases

Go to Databases in the sidebar to see all databases created for your server. Each entry shows the database name, username, host, and a button to reveal the password.

Rotating the Password

If you need to change a database password (e.g., for security reasons after removing a subuser who had access):

  1. Go to Databases
  2. Click the rotate icon next to the database
  3. The password will be regenerated
  4. Update the new password in all plugin configurations that use this database
  5. Restart your server

Deleting a Database

  1. Go to Databases
  2. Click the delete button (trash icon) next to the database you want to remove
  3. Confirm the deletion

Warning: Deleting a database permanently removes all data stored in it. This cannot be undone. Make sure you have a backup or no longer need the data before deleting.

Connection Strings

Some tools and plugins accept a connection string (also called a JDBC URL or DSN) rather than individual fields. The format is:

mysql://USERNAME:PASSWORD@HOST:PORT/DATABASE_NAME

Or in JDBC format (common for Java-based plugins):

jdbc:mysql://HOST:PORT/DATABASE_NAME

Replace the placeholders with your actual connection details from the panel.

Accessing the Database Directly

For advanced users who want to browse, query, or modify database contents directly, you have several options:

Using a Database Client

You can connect to your database from your local machine using tools like:

  • MySQL Workbench (free, cross-platform)
  • DBeaver (free, cross-platform)
  • TablePlus (paid, macOS/Windows/Linux)
  • HeidiSQL (free, Windows)

Enter the host, port, username, password, and database name from the panel. Make sure the Connections From field for your database is set to % or includes your IP address.

Command Line

If you are comfortable with the MySQL command line client:

mysql -h HOST -P PORT -u USERNAME -p DATABASE_NAME

You will be prompted for the password.

Common Issues

Plugin cannot connect to the database:

  • Double-check the host, port, username, password, and database name — a single typo will prevent the connection
  • Make sure the Connections From field is set to % or includes the correct source address
  • Verify the database exists in the panel (it may have been accidentally deleted)
  • Restart the server after making configuration changes

“Access denied” errors:

  • The username or password is incorrect. Copy them directly from the panel to avoid typos
  • If you recently rotated the password, make sure the new password is updated in all plugin configs

“Unknown database” errors:

  • The database name in your plugin config does not match the actual database name. Note that the panel may prefix your chosen name with a server identifier — use the full name shown in the panel.

Database is slow or unresponsive:

  • If many plugins are making frequent database queries, performance can degrade. Consider whether all plugins truly need MySQL or if some can use flat-file storage instead
  • Large databases (millions of rows) may need optimization. Contact support if you suspect database performance issues.

Data not persisting after restart:

  • Make sure the plugin is actually configured to use MySQL and not falling back to flat-file storage. Check the plugin’s startup logs in the console for database connection confirmations.

Best Practices

One database per plugin. While some plugins can share a database, using separate databases keeps things organized and makes troubleshooting easier.

Back up before major changes. If you are upgrading a plugin that modifies its database schema, create a server backup first. This captures the full server state including database configurations.

Use descriptive names. Name databases after the plugin that uses them (e.g., luckperms, economy). This makes it clear what each database is for when you have several.

Clean up unused databases. If you remove a plugin that used a database, delete the database too. Orphaned databases take up space and create clutter.

If you need help setting up a database for a specific plugin, open a ticket on Discord and let us know which plugin you are configuring.