Server databases

Log in to create and manage MySQL databases for your server.

What is a database?

A database is an organized place to store and look up information. Instead of keeping everything in loose text files, a database keeps data in a structured way so a program can read, add, or change it quickly, even when there are millions of records. Almost every website and app you use runs on one behind the scenes.

There are two broad families. Relational databases, like MySQL, MariaDB, and PostgreSQL, store data in tables of rows and columns and are the most common choice for almost everything. NoSQL databases, like MongoDB and Redis, store data in other shapes and are used when raw speed or flexibility matters more than strict structure. For a Minecraft server, the one you will almost always use is MySQL, which is exactly what this page creates for you.

What is a MySQL database?

MySQL is the most popular open-source relational database in the world. It powers a huge share of the internet, from small personal websites to some of the largest applications, and it is the standard database that game panels, plugins, and hosting providers support out of the box. When this page creates a "database" for your server, it is creating a MySQL database that your plugins can connect to and store their data inside.

You may also come across MariaDB. It is a drop-in replacement for MySQL, built by the original MySQL developers, and anything written for MySQL runs on MariaDB without changes. For a Minecraft server you can treat the two as the same thing.

Why would a Minecraft server need a database?

By default, most plugins save their data in flat files on the server, usually YAML or SQLite. That works fine for a small server, but it does not scale. Reading and writing large flat files gets slow, and the data is trapped on that one machine. A database fixes both problems at once: it handles large amounts of data far faster, and because it can be reached over the network, more than one server can share the same data.

This matters most in two situations. The first is busy plugins that write constantly, where flat files simply cannot keep up. The second is a server network, where several servers sit behind a proxy like BungeeCord or Velocity and share one database, so a player's rank, balance, or homes follow them from the lobby to the survival server to minigames without ever being out of sync. If you have ever joined a network and kept the same rank everywhere, a shared database is how.

Plugins that commonly use, or strongly benefit from, a database include:

  • LuckPerms - permissions and ranks, kept in sync across a whole network
  • CoreProtect - block and container logging, so you can roll back griefing
  • Essentials - homes, warps, and player data
  • Economy and shop plugins - balances, transactions, and stock
  • Most large network plugins - anything that stores per-player values

How do you connect a plugin to your database?

When you create a database on this page, you are handed everything a plugin needs to connect to it. You drop these values into the plugin's config file, usually in a section called "database", "storage", or "MySQL", switch the storage method to SQL, and restart the server. The plugin then creates its own tables inside the database automatically, and from that point on it reads and writes to MySQL instead of flat files.

Connection detailWhat it is
HostThe address of the database server the plugin connects to
PortThe port MySQL listens on, almost always 3306
DatabaseThe name of the database you created
UsernameThe account the plugin logs in with
PasswordThe password for that account

You will also see a "connections from" option when you create a database. That controls which remote addresses are allowed to connect. Leaving it open lets any host connect with the right credentials, while setting it to a specific address locks the database down to just that machine.

Flat files or a database: which should you use?

Neither is automatically "better", they suit different servers. The table below is the quick version.

Flat files (YAML / SQLite)MySQL database
SetupNone, works out of the boxCreate a database and add the credentials
Speed on large dataSlows down as data growsStays fast at scale
Shared across serversNo, tied to one serverYes, many servers can share it
Best forSmall single serversBusy servers and networks

For a small survival world with a couple of plugins, flat files are perfectly fine and simpler to manage. But once a server gets busy, runs heavy logging or economy plugins, or grows into a multi-server network, moving those plugins onto a database is one of the biggest performance upgrades you can make without spending a cent on more hardware.

Keeping your database secure

A database holds real data, so treat its connection details like a password, because one of them literally is. Anyone with the host, name, user, and password can read and change everything the database stores.

Never paste your database credentials into a public Discord, a pastebin, or a config file you share. If you think they have leaked, rotate the password straight away.

Two habits keep you safe. Use the "connections from" setting to limit which hosts can connect whenever you can, rather than leaving it open to the whole internet. And rotate the password if it is ever exposed. From this page you can change a database's password or delete a database outright at any time, so cleaning up after a mistake takes seconds.