Game servers

Installing MariaDB and connecting FiveM's database (oxmysql)

The database QBCore, ESX and Qbox need: installation on Windows and Linux, a dedicated user, the oxmysql connection string and the two most common errors.

2 min readUpdated on 6 October 2026FiveM

QBCore, ESX and Qbox store players, inventories and vehicles in a MySQL/MariaDB database. You install it once, on the same VPS, and FiveM connects through localhost.

Windows

  1. Download the MariaDB MSI installer (an LTS version) from mariadb.org/download.
  2. Install it and set a long root password. Keep Install as service ticked so it starts with Windows.
  3. The installer includes HeidiSQL, a program to view and edit the database with windows.

Linux (Ubuntu / Debian)

apt install -y mariadb-server
mariadb-secure-installation

Answer the questions: remove anonymous users and the test database.

Create the database and its user

Do not use root for FiveM. Open MariaDB (on Windows, from HeidiSQL or with mysql -u root -p; on Linux, with mariadb) and run:

CREATE DATABASE fivem CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'fivem'@'localhost' IDENTIFIED BY 'A_LONG_PASSWORD';
GRANT ALL PRIVILEGES ON fivem.* TO 'fivem'@'localhost';
FLUSH PRIVILEGES;

Those are the details txAdmin asks for when deploying the recipe: database fivem, user fivem and its password.

The connection string (oxmysql)

txAdmin writes it into your server.cfg. If you set it by hand, it looks like this:

set mysql_connection_string "mysql://fivem:A_LONG_PASSWORD@localhost/fivem?charset=utf8mb4"

ensure oxmysql must come before the framework in the load order. If your password contains symbols such as @ or #, change it for one without them: they break the string.

Do not open port 3306

The database is only used by the FiveM server on the same machine. Opening 3306 to the internet invites attacks. To manage it from your PC, use HeidiSQL with its SSH tunnel option (on Linux) or connect over remote desktop (on Windows).

The two most common errors

Console errorWhat it means
ECONNREFUSED 127.0.0.1:3306MariaDB is not running. On Windows, check the service in services.msc; on Linux, systemctl status mariadb.
Access denied for userUser, password or database name mistyped in the connection string.

And take backups: the daily database dump is what saves you if a script wipes the inventories.

Related articles

Back to the help centre

Can’t find what you need?

Open a ticket from your panel and we will answer in under 5 minutes.