Plenty of server software needs a proper place to keep its data. Permission plugins, economy plugins, web maps, ban lists shared between servers, and every ESX or QBCore setup on FiveM all expect a MySQL database. You can create one yourself from the panel in under a minute, and the panel hands you every value you need to connect.
What you need
- Your server in the game panel
- The config file of the plugin or resource that needs the database, open in another tab
Step 1: open the Databases tab
Open the game panel, select your server, and click Databases in the left menu. It sits in the Advanced group, together with Network, Schedules, Activity and Access.
The top of the card tells you how many slots you have, for example 0 of 1 databases used. New servers come with one database slot, which is enough for most setups: one database can hold the tables of several plugins side by side, because each plugin names its own tables.
If the tab says Databases not available, this server has no database slots. Open a ticket from the support page and we will look at it with you.
Step 2: create the database
- Click New database
- Type a short name, for example
survivaloreconomy. Only letters, numbers and underscores are accepted. - Click New database in the dialog to confirm
The panel creates the database and a user for it with a generated password, then shows the new database in the list with the password already revealed.
Note the name you end up with. A prefix is added automatically, so survival becomes something like s1234_survival. That full name is the one your plugin needs.
Step 3: copy the connection details
Each database in the list shows five values, each with its own copy button:
| Field | What it is |
|---|---|
| Database name | The full name, prefix included |
| Host | The address of our database server, without a port |
| Port | The MySQL port, normally 3306 |
| Username | The database user created for you |
| Password | Hidden until you click the eye icon (Show password) |
Copy them with the buttons rather than typing them. Three mistakes cause almost every failed connection:
- Using localhost or root. The database does not run inside your game server, it runs on a separate database host.
localhost,127.0.0.1and the userrootwill never work. - Pasting the port into the Host field. Most configs have their own port setting. Put the host in one and the port in the other.
- Inventing a database name. Setup wizards often suggest a name of their own. Use the prefixed name from the panel instead.
Step 4: put the details in your plugin config
Every plugin names these settings a little differently, but they always map to the same five values. Here is how it looks in LuckPerms, a common Minecraft permissions plugin, in plugins/LuckPerms/config.yml:
storage-method: MySQL
data:
address: YOUR_HOST:3306
database: s1234_survival
username: YOUR_USERNAME
password: 'YOUR_PASSWORD'
LuckPerms has no separate port setting, so this is the one kind of config where host and port go together as host:port. When a config does have a port field, keep them apart.
Save the file and restart the server. Most plugins only read their database settings when they load, so editing the file while the server runs changes nothing until the next restart. Watch the Console tab as the server starts: a plugin that fails to connect usually says so there, often with Access denied or Communications link failure in the message.
FiveM: the oxmysql connection string
On a FiveM server the Databases tab does one extra thing. Under the list you get an oxmysql connection string for your first database: a complete set mysql_connection_string "..." line with the host, port, name, username and password filled in. Copy it with its button and paste it near the top of server.cfg. If txAdmin manages your server, add it in the txAdmin settings instead.
In the rare case the password contains a character oxmysql cannot read, the panel warns you instead of showing a broken line, with a Generate new password button next to the warning.
Connecting from your own computer
The same five values work in a desktop MySQL client such as HeidiSQL or DBeaver, which is handy for looking inside the tables or importing an existing database. Pick MySQL (or MariaDB) as the connection type and fill in the fields one by one.
Changing the password
Click New password on the database row. A new password is generated and shown straight away, and the old one stops working at once. Update every config that uses the database and restart the server, or the plugins keep trying the old password.
Do this whenever the password may have been shared by accident, for example in a screenshot or a public paste of your config.
Deleting a database
Click the trash icon on the row and confirm in the Delete database dialog. The database and every table in it are removed permanently and cannot be restored. The slot becomes free again, so you can create a new one straight after.
Server backups in the Backups tab contain your server's files, not the database, which lives on the database host. If the data matters, export it with a desktop client before you delete anything.
Troubleshooting
Access denied for user. The username or password does not match. Copy both again from the panel, check for a space at the start or end, and make sure you did not click New password after writing the config.
Unknown database. The name is missing its prefix. Copy Database name from the panel.
Connection refused or timed out. The host is wrong, usually localhost, or the port is glued to the host in a field that expects only the host.
The New database button is greyed out. All your slots are in use. Delete a database you no longer need, or let several plugins share one database.
The name is rejected. Only letters, numbers and underscores are allowed, and a name you already used cannot be used twice.
Stuck? Open a ticket from the support page with your server name and the error from the console, and we will check it with you.