How to add a database to your Minecraft server

Print
  • 0

Many Minecraft plugins can use MySQL for shared or persistent data. LuckPerms, Plan, CoreProtect, Dynmap, voting plugins, economy plugins, and network-wide setups are common examples.

Let the plugin installer configure it

For supported plugins such as CoreProtect, the easiest option is to open Plugins, find the plugin and use its installer. When Configure automatically is offered, leave it ticked and choose Managed database under Storage. The panel uses the database assigned to this server, or creates one if your limit allows, and writes the connection details into the supported plugin's config.

CoreProtect automatic configuration using a managed database

Local storage keeps the plugin's data in its local files instead. Changing this selection does not migrate existing plugin data between local storage and MySQL. Back up the current data and follow the plugin's migration instructions before changing storage on an established server.

If automatic configuration is not available, or you need to enter a particular database yourself, use the manual steps below.

Create a plugin database

  1. Open your Minecraft server in the Ptero control panel, then open Databases.
  2. Click Create Database.

    Databases page for a Minecraft server on Ptero

  3. Use a name that tells you which plugin it belongs to, such as luckperms, coreprotect, or plan.
  4. For most Minecraft plugins, leave Connections From empty. The panel will show this as %. If you need to restrict database access, use the IP addresses, hostnames, or wildcard patterns that should be allowed.
  5. Click Create Database.

    Create database form for a Minecraft server

Use it in your plugin config

Click the eye icon next to the database to view the endpoint, username, and password.

Minecraft plugins often ask for these values as separate config options. The endpoint is written as host:port, so anglo.logicserver.co.uk:3306 would be split into host anglo.logicserver.co.uk and port 3306.

If you rotate the database password from this screen, update the plugin config before starting the server again. A plugin using the old password will usually show database connection errors in Console.

Database endpoint and connection fields with credentials hidden

After editing the plugin config, restart your Minecraft server and check Console for any database connection errors.

New panel backups include the databases registered on this server automatically. Restoring database contents requires selecting them under Advanced restore options; a normal files-only restore leaves them unchanged.

Use phpMyAdmin

You can open phpMyAdmin by clicking the phpMyAdmin icon next to the database.

Our phpMyAdmin guide covers opening and using the database in your browser.


Was this answer helpful?

Related Articles

« Back

Follow us on Social Media

Stay in the loop! Follow our social media accounts and stay up-to-date with the latest news, announcements, tips & tricks and behind-the-scenes insights!