Halloween Sale 10% off for life with code

Setting up a FiveM database with the MySQL Setup tab

Add your license key, create a MariaDB database from your plan at no extra cost, make a database user and write the connection string into server.cfg.

Last updated November 6, 2026

Most FiveM frameworks, such as QBCore, Qbox and ESX, need a MySQL database. On ServerPrism the MySQL Setup tab walks you through it: it sets your license key, creates a MariaDB database server from your current plan, makes a database user, and writes the connection string into your server.cfg. This guide follows the tab step by step.

Open your FiveM server and click MySQL Setup in the sidebar (under FiveM). The top of the page shows how many steps are left. You can Skip setup at any time and Resume setup later.

Step 1: FiveM license key

FiveM needs a free license key from keymaster.fivem.net. Sign in there, create a server key, copy it, paste it into License key and click Save.

The key is saved to the FxServer License Key setting on the Startup tab, so you can also change it there later.

If you see Server ports need attention, click Auto-fix ports. A FiveM server with txAdmin needs three ports in a row and the txAdmin port has to be one of them; the fix sets that up for you. Servers without txAdmin (see step 5) skip this check.

Step 2: Database server

Your database runs as its own small server next to your FiveM server.

  1. The tab shows how your plan would be split, for example "FiveM (this server)" and "MariaDB (new)", each with its RAM. There is no extra cost: your plan's resources are divided between the two.
  2. Click Create MariaDB server and confirm.

Your FiveM server restarts briefly while the split runs. The new database server then starts on its own. If it shows as offline later, click Start database.

The owner can also choose Custom split to pick the sizes on the Split Server tab. You can undo a split there too.

Step 3: Database user

Click Provision database user. We create a user and a database called fivem_db with a strong random password, and save the details so you only do this once.

You then see Database details for txAdmin setup: Host, Port, Database name, Username and Password, each with a copy button. Copy all (txAdmin format) copies everything at once, ready to paste into txAdmin's database step. On a server without txAdmin the card is called Database details and the button Copy all; use the details in your resources, or let step 4 write them into server.cfg.

The same card has a Reset password button for when you need a new database password (see "Changing the database password" below).

Step 4: Apply to .cfg files

Click Rescan, then Apply connection string. We look through your .cfg files and write a line like this into the right one:

set mysql_connection_string "mysql://USER:PASSWORD@HOST:PORT/fivem_db?charset=utf8mb4"

If no line exists yet, it is added to the server.cfg your server actually loads. The file FXServer loads is marked Active; other server.cfg files inside resource folders or recipe templates are just examples.

Restart your server after applying, so resources like oxmysql pick up the new connection.

Step 5: Start the server (and open txAdmin)

When every step is done (or skipped), a last card appears telling you that you are all set.

  1. Click Start server. FXServer takes 30 to 60 seconds to come online.
  2. Click Open txAdmin. The txAdmin URL is shown on the card with a copy button.
  3. The first time, txAdmin asks for a PIN. You'll find it in the Console.
  4. Create your txAdmin admin account, then pick a recipe (QBCore, ESX, and so on). When txAdmin asks for database details, paste what you copied in step 3.

After txAdmin has set up your recipe, come back to MySQL Setup and run step 4 again. Recipes often create their own server.cfg, and the tab keeps the connection string in sync with it.

No txAdmin on FiveM Enhanced, or with txAdmin turned off. FiveM Enhanced servers, and FiveM servers where Enable / Disable TxAdmin on Startup is set to 0, start straight from server.cfg and don't run txAdmin. The last card then says Your server starts straight from server.cfg. and has no Open txAdmin button. Only step 1 above applies: add your resources in File Manager, list them in server.cfg and restart.

Managing the database

Open the MariaDB server from your services list and use DB Manager for tables, queries, imports and exports. Open Database Manager opens it in a new tab; the access link expires after 5 minutes. For moving a database from another host, see Backing up, importing and exporting a database.

Changing the database password

If someone else saw the password, give the database user a new one yourself:

  1. Start the database server if it isn't running. The button only works while it is online.
  2. On MySQL Setup, click Reset password on the Database details card.
  3. In Reset database password?, click Reset password. The old password stops working right away.
  4. The New password window shows the new password once. Click Copy and keep it somewhere safe: for your security we show it only there and never send it by email.
  5. Click Apply connection string (step 4) so server.cfg gets the new password, then restart your FiveM server. Until you do, the server keeps trying the old password.

Update any other app that connects with this database user too. You can also reset it from DB Manager on the MariaDB server.

Common issues

What you see What to do
Scripts can't connect to the database (for example ECONNREFUSED) Check that the MariaDB server is running, then go to step 4 and Apply connection string to the file marked Active. Restart FiveM.
Database fivem_db is missing Click Create fivem_db, then restart your FiveM server.
MariaDB server must be running to provision a user Start the database server first (Start database), wait until it is online, then try again.
Pay your pending invoice before splitting Splitting is blocked while an invoice is open. Pay it, then come back.
Splitting is not available on trial servers The database step needs a paid plan.
The txAdmin URL isn't available Start the server first; txAdmin only answers once it is running. FiveM Enhanced, and FiveM with txAdmin turned off, have no txAdmin at all.
Scripts lost the database after a password reset Click Apply connection string on MySQL Setup and restart the server.

For general FiveM setup, see Getting started with GTA V: FiveM. If something on this page doesn't match what you see, open a support ticket and we'll go through it with you.