FiveM Database Setup: MariaDB and HeidiSQL Guide
FiveM database setup step by step: install MariaDB instead of XAMPP, create a database and an account, connect HeidiSQL and oxmysql, then import SQL files.
- Applies to
- FiveM Legacy and FiveM for GTAV Enhanced; the Qbox, ESX Legacy, StreetKings and WarfareTacticsV txAdmin recipes (November 2026), existing QBCore servers; oxmysql 2.14.4 (November 26, 2026); MariaDB 10.11, 11.4, 11.8 and 12.3 LTS (12.3.4, November 16, 2026); HeidiSQL 12.22 (October 25, 2026); Windows, Debian and Ubuntu
- Last verified
On this page
- Direct Answer
- What a FiveM database stores and which servers need one
- MariaDB, MySQL or XAMPP for FiveM
- Which MariaDB version to install for FiveM
- Step 1: Install MariaDB for FiveM
- Step 2: Create the database and an account for FXServer
- Step 3: Connect HeidiSQL to your FiveM database
- Step 4: Connect FXServer to the database
- How to import an SQL file into a FiveM database
- Back up the database before you change it
- Keep the database private: bind-address and port 3306
- Move a server from XAMPP or MySQL to MariaDB
- A FiveM database at a game server host
- Troubleshooting
- Next Steps
Direct Answer
A FiveM database setup has four parts: a MariaDB server, a database with an account for it, the oxmysql resource and a set mysql_connection_string line in server.cfg. Install MariaDB on its own, 10.9.0 or newer for Qbox: the MSI from mariadb.org on Windows, which also installs HeidiSQL for running SQL, importing .sql files and backups, or the mariadb-server package on Linux. Skip XAMPP, which the oxmysql, Qbox and ESX documentation all advise against. A txAdmin recipe for Qbox or ESX Legacy then creates the database, imports its SQL and writes the connection string from the login you enter. On Linux, create a password account for that login first.
What a FiveM database stores and which servers need one
Frameworks and game modes keep their saved data in the database. ESX’s install guide says the framework “stores all player data, inventories, jobs, and vehicles in MariaDB”. The Qbox docs describe the database as the place where your server “stores characters, money, vehicles and so on”.
Not every server needs one. Cfx.re’s txAdmin setup guide tells new owners to pick the CFX Default template for now, because other templates exist, “but some will require a database server”. txAdmin shows database options only when the recipe you pick contains a database task. The ESX Legacy and Qbox recipes do, and so do two game modes, the StreetKings racing recipe and WarfareTacticsV. All four run connect_database; the two framework recipes and StreetKings then import SQL files with query_database, StreetKings its own streetkings.sql.
| Part | What it is | Where it comes from |
|---|---|---|
| MariaDB server | The program that stores the data. It listens on TCP port 3306 by default | The installer from mariadb.org, or your Linux distribution’s packages |
| Database and account | A named database for your server, and the login FXServer uses | txAdmin’s deployer creates the database; a dedicated account is yours to create |
oxmysql | The resource that connects FXServer to the database | Downloaded by the Qbox, ESX Legacy, StreetKings and WarfareTacticsV recipes. qbx_core, es_extended and QBCore’s qb-core all list it as a dependency |
mysql_connection_string | The server.cfg convar that tells oxmysql the host, account, password and database | Written by the deployer, or by you on a manual install |
The steps are the same on FiveM Legacy and FiveM for GTAV Enhanced. txAdmin’s Legacy recipe index (indexv4.json) and its Enhanced index (indexv5.json) load the same Qbox and ESX Legacy recipe files, and Cfx.re’s page on what changed in Enhanced lists no database changes. Existing QBCore servers use the same oxmysql setup. If you have not chosen a framework yet, the QBCore, Qbox and ESX comparison covers where each one stands in 2026.
MariaDB, MySQL or XAMPP for FiveM
| Source | What it says |
|---|---|
| oxmysql documentation | “MariaDB is highly recommended for compatibility”. Most FiveM resources were designed for MySQL 5.7 and “may hit compatibility issues when using MySQL 8” |
| Qbox installation page | “We expect you to already have MariaDB installed. MySQL is not supported.” Minimum version: MariaDB 10.9.0 |
| ESX install guide | “ESX requires a MySQL-compatible database”, next to the instruction “Use MariaDB only.” |
| txAdmin recipe documentation | The database task “Connects to a MySQL/MariaDB server” |
oxmysql describes itself as having “improved compatibility for MySQL 8”, so the connector works with MySQL. Qbox is the one that rules MySQL out, and the Qbox and ESX documents both point to MariaDB.
Should you use XAMPP for a FiveM server?
No. Three official sources say so plainly:
- oxmysql: “XAMPP is a webserver stack intended to be used for development”, and “Do not setup XAMPP just to run your database, and install MariaDB directly instead.”
- Qbox: “XAMPP IS NOT SUPPORTED AND SHOULD NEVER EVEN BE USED.”
- ESX: “Do not use XAMPP. It is outdated, unstable for production servers, and has been known to cause data loss.”
XAMPP’s own site calls it “an easy to install Apache distribution containing MariaDB, PHP, and Perl”. On November 21, 2026, its Windows downloads bundled MariaDB 10.11.19 together with Apache, PHP, phpMyAdmin, a mail server, an FTP server and Tomcat. The database inside is MariaDB; what XAMPP adds is a web development stack a FiveM server does not use. Old XAMPP installs carry old databases: the Qbox docs list 10.4.x-MariaDB as too old and add “This is common with XAMPP.”
One official message still points the other way. When txAdmin’s Recipe Deployer cannot reach a database on Windows, it adds “If you do not have a database installed, you can download and run XAMPP.” On Linux the same message says “you must download and run MySQL or MariaDB.” The txAdmin hint and the framework and oxmysql documentation disagree here. Follow the documentation and install MariaDB.
Which MariaDB version to install for FiveM
Qbox publishes a version floor: MariaDB 10.9.0. Its installation page gives the reason. The core resource uses JSON_VALUE(), which needs MariaDB 10.6.1, and creates indexes with CREATE INDEX IF NOT EXISTS when it starts, which needs 10.9.0. The ESX install guide and the oxmysql documentation name no minimum version.
For new servers Qbox recommends MariaDB 12.3 LTS and adds that “Older LTS releases such as 10.11 or 11.8 also work”. MariaDB Foundation’s download service listed these long-term support series on December 2, 2026:
| Series | Status | Support type | End of life |
|---|---|---|---|
| 10.11 | Stable | Long Term Support | February 16, 2028 |
| 11.4 | Stable | Long Term Support | May 29, 2029 |
| 11.8 | Stable | Long Term Support | June 4, 2028 |
| 12.3 | Stable | Long Term Support | June 12, 2029 |
All four are above Qbox’s floor. The newest 12.3 release that day was 12.3.4, published on November 16, 2026. The same list shows 13.1 as a stable release and 13.2 as a release candidate, both with the support type “Rolling”, so neither is a long-term series.
Step 1: Install MariaDB for FiveM
Windows: the MSI installer
- Download the MSI. On mariadb.org/download, choose a series under MariaDB Server Version, Windows under Operating System and the MSI package under Package Type. For 12.3.4 the file is
mariadb-12.3.4-winx64.msi. - Run it and accept the license agreement.
- Keep the default features in Custom Setup. By default every feature except the debug symbols is installed, and the list includes the database instance and HeidiSQL. Qbox’s instruction is “Leave HeidiSQL ticked, so it gets installed too.”
- Set a password for
rootand write it down.rootis the administrator account of the database server. The same dialog asks whetherrootmay access databases from remote machines; leave that off. Create anonymous account is off by default, and MariaDB recommends not changing it. Avoid the characters that oxmysql lists as reserved or unsupported in a connection string:; , / ? : @ & = + $ #. - Keep Install as service and Enable Networking. The service is named
MariaDBby default. Enable Networking turns on TCP/IP and sets the port, 3306 by default. txAdmin and oxmysql connect with a host and a port, so leave it on. If an older database server already uses 3306, the installer suggests 3307: keep it and write it down. - Leave the InnoDB engine settings as they are. MariaDB documents the default buffer pool size as 12.5% of RAM and says the 16k page size “is suitable for most situations”.
- Click Install. When the database instance was installed as a service, “the service will be running already” once the installer finishes.
The installer also offers UTF8 as the default server character set, which adds character-set-server=utf8 to my.ini. Afterwards the Start Menu has a MariaDB Client entry for the command-line client, plus Error log and my.ini shortcuts that open those files in Notepad.
Ubuntu and Debian: check the packaged version first
The distribution’s own package is the quickest route, but not every release ships a version Qbox accepts:
| Release | MariaDB in the release | Meets Qbox’s 10.9.0 floor |
|---|---|---|
| Debian 11 (bullseye) | 10.5 | No |
| Debian 12 (bookworm) | 10.11 | Yes |
| Debian 13 (trixie) | 11.8 | Yes |
| Ubuntu 22.04 LTS (jammy) | 10.6 | No |
| Ubuntu 24.04 LTS (noble) | 10.11 | Yes |
| Ubuntu 26.04 LTS (resolute) | 11.8 | Yes |
The Debian versions come from Debian’s release notes, the Ubuntu versions from Ubuntu’s package search on November 21, 2026. Qbox’s Linux tutorial asks for “A fresh Ubuntu 20.04+ or Debian 11+ server” and installs the distribution package. On Debian 11 and Ubuntu 22.04 that package is older than the floor on Qbox’s own installation page, so use MariaDB’s repository there instead. The MariaDB Server Repositories tab of mariadb.org/download asks for your distribution, a MariaDB Server version and a mirror. As the page notes, “MariaDB Foundation provides packages for MariaDB versions newer than the version provided by the distribution only.”
On the other releases, install the distribution package. The commands come from MariaDB’s quickstart and Qbox’s tutorial:
sudo apt update
sudo apt install -y mariadb-server mariadb-client
sudo systemctl status mariadb
MariaDB “typically starts automatically after installation”. If the status shows it stopped, sudo systemctl start mariadb starts it. Installing FXServer itself on these systems is covered in the Linux server guide.
On Linux, root logs in through sudo, not a password
MariaDB’s troubleshooting guide puts it in one line: “The default security model for Linux installations uses the unix_socket authentication plugin.” The root@localhost account “accepts the operating system user root through unix_socket, and has no usable password”. Three things follow:
- Administer the server with
sudo mariadb. It asks for no database password. Older tutorials typemysql, which on Unix systems is a symlink to the samemariadbclient. - Password logins as
rootfail until a password is set. Run from a normal user,mariadb -u root -pends inAccess denied for user 'root'@'localhost', in MariaDB’s words “with or without a password”. - FXServer cannot log in as this
root. The deployer and oxmysql log in with a user name and a password. Create a dedicated account in Step 2. MariaDB gives the same advice: usesudo“as a one-off”, then “create a proper user”.
Qbox’s Linux tutorial, like MariaDB’s own quickstart, then runs the secure-installation script and sets a root password. MariaDB’s page for the script, now called mariadb-secure-installation, says the opposite: many reasons for the script “no longer apply” and “there is usually no need to create a root password”. The script still lets you remove anonymous accounts, root accounts that can be reached from outside the local host, and the test database.
Step 2: Create the database and an account for FXServer
Deploying a framework from a txAdmin recipe on Windows? The deployer creates the database itself and can log in as root, so you can go to Step 4 now and add the account afterwards. ESX’s post-installation checklist asks for exactly that: “Create a dedicated MariaDB user for ESX instead of using root (security best practice)”. To add it afterwards, run the statements below without the CREATE DATABASE line and with the name of the database the deployer created, then put the new user and password in mysql_connection_string, the line in server.cfg that holds the login your server uses. On Linux, do this step first, because root has no password the deployer can use.
Open a SQL prompt: sudo mariadb on Linux, or HeidiSQL’s Query tab on Windows (Step 3 shows how to connect). The statements below are the database block of Qbox’s Linux tutorial. Replace fivem_server, fivem_user and your_password with your own values, and keep the characters oxmysql reserves (; , / ? : @ & = + $ #) out of the password:
CREATE DATABASE fivem_server;
CREATE USER 'fivem_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON fivem_server.* TO 'fivem_user'@'localhost';
FLUSH PRIVILEGES;
| Part | What it does |
|---|---|
CREATE DATABASE | Creates the database. Its CHARACTER SET and COLLATE clauses are optional; left out, the server defaults are used |
'fivem_user'@'localhost' | An account name has a user part and a host part. 'localhost' allows local connections only. With no host part, MariaDB assumes '%', which matches any host |
IDENTIFIED BY | Sets the password. Without this clause the account connects with no password |
GRANT ... ON fivem_server.* | A new account starts with no privileges. fivem_server.* is the database level: it covers all tables in that database, “including those created later” |
ALL PRIVILEGES | Every privilege at that level, but not GRANT OPTION. A framework needs more than reading and writing rows: Qbox adds columns and creates indexes from its core resource |
FLUSH PRIVILEGES | Not required. MariaDB says it “is only needed if one modifies the mysql tables directly” and is “not needed when using CREATE USER, DROP USER, GRANT etc.” |
For Qbox, give the database Qbox’s collation. A collation is the set of rules a table uses to compare and sort text. The core tables in Qbox’s qbx_core.sql declare utf8mb4_unicode_ci, and its docs warn that linked tables “must use the same collation”. At the prompt, write the first statement as CREATE DATABASE fivem_server CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;. In HeidiSQL, right-click your connection (the top line of the list on the left), choose Create new, then Database, type the name, set Collation to utf8mb4_unicode_ci and click OK. When you deploy Qbox from its recipe, the deployer would otherwise create the database with utf8_general_ci. Create it this way first and type its name in the deployer’s Database Name field in Step 4: a name other than the default switches Delete Database off, and CREATE DATABASE IF NOT EXISTS only returns a warning for a database that already exists.
Which collation a new FiveM database gets
| How the database is created | Default character set and collation |
|---|---|
| txAdmin’s deployer | utf8 and utf8_general_ci |
CREATE DATABASE without clauses, MariaDB 11.6 or newer | The server default, utf8mb4 and utf8mb4_uca1400_ai_ci |
CREATE DATABASE without clauses, before MariaDB 11.6 | The server default, latin1 and latin1_swedish_ci |
MariaDB adds that the server default “may differ in some distros”. It also changes with the character_set_server variable, so on Windows the installer’s UTF8 option, which writes character-set-server=utf8 to my.ini, changes it too. A table takes the database default only when its SQL names neither a character set nor a collation. The tables in Qbox’s qbx_core.sql declare utf8mb4 and utf8mb4_unicode_ci. Most tables in ESX’s legacy.sql declare neither, so they take whatever the database default is. Tables that refer to each other must end up with the same collation; a mix is what produces the foreign key error under Troubleshooting.
Step 3: Connect HeidiSQL to your FiveM database
HeidiSQL comes with the MariaDB installer for Windows. Otherwise it is a separate download from heidisql.com, where version 12.22 was released on October 25, 2026. Its help calls it “a so called client application, only usable when you have some server available”.
- Open HeidiSQL. The Session manager opens.
- Click New at the bottom left.
- Fill in the session with the values from the table below.
- Click Open.
| Field | Value |
|---|---|
| Network type | MariaDB or MySQL (TCP/IP) |
| Hostname / IP | 127.0.0.1 when the database runs on the same PC |
| User and Password | root and the installer password, or the account from Step 2 |
| Port | 3306, or the port the installer used instead |
HeidiSQL’s help notes that most settings of a new session are already filled in, “except from the password, which is mostly not an empty one on a newly installed MariaDB server”.
Once you are connected, three habits from Qbox’s basics page prevent most mistakes:
- Select the database first. The list on the left shows every database on the server, and every command runs on the selected one.
SELECT DATABASE();shows which one that is. - Run SQL in the Query tab. Paste the statement, then click the blue Execute SQL button or press F9. Results appear in a grid below; an error opens a popup that starts with SQL Error.
- Press F5 to refresh the list after you add or change tables.
Check the server version with SELECT VERSION()
Run this in the Query tab:
SELECT VERSION();
| Result | Meaning |
|---|---|
A value such as 11.8.3-MariaDB or 12.0.2-MariaDB, at 10.9 or higher | Fine for Qbox |
10.4.x-MariaDB or another version below 10.9 | Too old for Qbox; common with XAMPP |
A number without MariaDB, such as 8.0.36 | MySQL, which Qbox does not support |
A database on a Linux VPS: HeidiSQL through an SSH tunnel
HeidiSQL can reach a database server “which is only accessible via SSH”, so the database port can stay closed. Pick the SSH tunnel network type (the help lists it as MariaDB/MySQL (SSH tunnel)) and use the help’s example settings:
- Settings tab: Hostname
127.0.0.1, the database account’s password, and Port 3306 “in most cases”. - SSH tunnel tab: your server as SSH host, port 22 “in most cases”, your SSH user and password, and Local port 3307.
The HeidiSQL installer places plink.exe in the right folder, and recent versions can use Microsoft’s ssh.exe instead. Log in with a password account such as the one from Step 2: the Linux root account only accepts the system root user through the local socket file.
Step 4: Connect FXServer to the database
New server: the database options in the txAdmin deployer
When a recipe contains database tasks, the deployer’s Step 2: Input Parameters shows a button named Show/Hide Database options (advanced). The fields behind it start collapsed but already filled in, so the defaults are used unless you open it.
| Field | Default | What to enter |
|---|---|---|
| Database Host | localhost | Keep it when MariaDB runs on the same machine |
| Database Port | 3306 | The installer’s port if it differs |
| Database Username | root | root on Windows; on Linux the account from Step 2 |
| Database Password | Empty | The password you set. The field’s hint reads “(usually blank)”, which does not hold for a MariaDB server installed as described above |
| Database Name | The deployment ID, such as PlumeESX_BBC957 | Keep it with root. With a dedicated account, type the database that account has privileges on |
| Delete Database | On | Read the first point below |
Before you move on to Step 3: Run Recipe:
- Know what Delete Database does. Its hint says it “automatically deletes the database with the name provided above” and warns “all data will be lost.” The switch is On for the default name. Typing a different name in Database Name switches it Off; clearing the field or typing the default name switches it back On. Qbox’s migration guide gives the safe rule: “Never delete or empty a database to reuse it. Always make a new one.”
- txAdmin tests the login first. It connects with the host, port, user and password before any task runs. If that fails, the page shows “Database connection failed:” and the reason; Troubleshooting covers both usual reasons.
- The database is created when needed. The deployer drops the database if Delete Database is on, runs
CREATE DATABASE IF NOT EXISTSwith the name, and then runs the recipe’s SQL files in it. A dedicated account can do this for its own database, because MariaDB lets you grant theCREATEprivilege “on databases that do not yet exist”.
When the tasks finish, the deployer replaces the variables in server.cfg, which fills in the connection string. Qbox’s migration guide shows the result:
set mysql_connection_string "mysql://root:YourPassword@localhost/qbox_a1b2c3?charset=utf8mb4"
The port appears after the host only when it is not 3306. With an empty password, the string has no :password part. The txAdmin recipe guide walks through the other deployer steps.
Existing server or manual install: oxmysql and mysql_connection_string
oxmysql’s documentation gives the manual installation in three moves: download the latest release of oxmysql, add start oxmysql to the top of your resource list, and set the connection string “before starting any resources”. It accepts two formats:
set mysql_connection_string "mysql://root:12345@localhost:3306/fivem"
set mysql_connection_string "user=root;password=12345;host=localhost;port=3306;database=fivem"
Use one of the two lines, with your own account, password and database name in place of root, 12345 and fivem.
- Only ever use
set. That is the wording of the oxmysql docs. Cfx.re’s convar reference explains the difference: a standard convar “can only be used in server-side scripts”, while asetrconvar is made “available on the client side”. The connection string holds your database password. - A different port goes after the host, as in Qbox’s example
mysql://root:YourPassword@localhost:3307/qbox_migration?charset=utf8mb4. - Without the line, oxmysql does not stop. Version 2.14.4 falls back to
mysql://root@localhost, which isrootwith no password and no database. A missing or misspelled line therefore shows up as a login attempt byrootwithout a password.
Restart the server and read the console, the Live Console page in txAdmin. On success, oxmysql prints the database server’s version in square brackets, followed by Database server connection established!. On failure, it prints Unable to establish a connection to the database with the error code in brackets and the error message, then its connection settings with the password shown as ******. It tries again every 30 seconds. The oxmysql connection string guide covers every other option of that line.
How to import an SQL file into a FiveM database
A recipe imports its own SQL, so a freshly deployed framework needs no manual import. You import by hand when a resource you add later asks for it. ESX’s vehicle shop README is a typical example: “Import esx_vehicleshop.sql in your database”.
Before you run any file:
- Back up first. The next section shows how. MariaDB’s restore guide warns that when a file contains
DROP TABLEandCREATE TABLEstatements, “existing tables with the same names will be dropped and recreated”. - Look inside the file. Open it in a text editor and search for
CREATE DATABASE, then forDROP DATABASE. MariaDB notes that dump files often containCREATE DATABASE IF NOT EXISTSandUSEstatements. Qbox’s basics page explains the consequence: such a file “would write into your original database instead of the new one”.
HeidiSQL:
- Select the database in the list on the left.
- Click File, then Run SQL file… and pick the file.
- Choose the encoding if you know it. Below the file name there is an Encoding menu. HeidiSQL’s help calls “Auto detect” “a common way to get broken data afterwards” and tells you to select the right one, for example “UTF-8”.
- Click OK. HeidiSQL starts executing the commands immediately and shows the progress. Press F5 afterwards and the new tables appear in the list.
Command line (Linux):
mariadb --user your_username --password your_database_name < /path/to/your/backupfile.sql
The client asks for the password, and the < sign feeds the file to it.
phpMyAdmin (hosted databases): open the database first, then go to the Import tab. phpMyAdmin’s documentation adds that you can drag an SQL file from your file manager onto the phpMyAdmin window.
The rest of a resource install, from the folder to the ensure line, is covered in how to install FiveM scripts. For an escrowed resource that will not start, see the entitlement error guide.
Back up the database before you change it
HeidiSQL: right-click the database and choose Export database as SQL, make sure your database is ticked on the left, and use Qbox’s settings:
| Option | Setting | Why |
|---|---|---|
| Database(s) | Untick Drop and Create | The backup can be loaded into a database with a different name later |
| Table(s) | Tick Create, untick Drop | A backup loaded into the wrong database by mistake fails instead of overwriting tables |
| Data | Insert | The default; No data would export the structure only |
| Output | Single .sql file | Use a file name with the date |
HeidiSQL’s help describes its export as “basically what mysqldump also does”.
Command line (Linux): MariaDB’s backup guide gives this form for a database of InnoDB tables:
mariadb-dump --user=admin_backup --password --single-transaction --extended-insert --databases your_innodb_database > /data/backup/your_innodb_database.sql
mariadb-dump“was previously known as mysqldump”, and it can run while the database server is running.--single-transactionreads “from a consistent snapshot without locking the tables for extended periods”.--databasesputsCREATE DATABASEandUSEstatements into the file, so it restores into a database of the same name.
Replace admin_backup with an account that can read the database and your_innodb_database with your database. MariaDB’s guide adds that --single-transaction may also need the PROCESS and RELOAD privileges, which a database-level grant such as the one in Step 2 does not include. Test a backup by restoring it somewhere that is not your live server, and store backups outside the server folder. If a live database is ever damaged, Qbox’s advice is “don’t load the backup over it”: load it into a new database and change the database name in mysql_connection_string.
Keep the database private: bind-address and port 3306
When FXServer, MariaDB and HeidiSQL run on the same machine, nothing outside it needs port 3306. The official sources do not describe MariaDB’s default listening address the same way:
- MariaDB’s system variable reference: “By default, the MariaDB server listens for TCP/IP connections on all addresses”, and “In some systems, such as Debian and Ubuntu, the bind_address is set to 127.0.0.1”.
- Qbox’s remote access article: “By default, MariaDB only listens on localhost (127.0.0.1).”
- MariaDB’s page for the Windows installer: “If security is a concern, you can change the bind-address parameter post-installation to bind to only local addresses.”
Debian and Ubuntu packages start local-only. On Windows, do not assume it. To bind the server to the local machine, add bind-address = 127.0.0.1 under the [mysqld] section of the configuration file and restart MariaDB:
| Windows | Debian and Ubuntu | |
|---|---|---|
| Configuration file | my.ini in the data directory, for example C:\Program Files\MariaDB X.X\data\my.ini | /etc/mysql/my.cnf |
| Restart | net stop MariaDB, then net start MariaDB, in a Command Prompt opened as administrator | sudo systemctl restart mariadb |
When another machine really does need the database, Qbox’s remote access article first sets bind-address = 0.0.0.0 under [mysqld], so that MariaDB listens on all network interfaces. Its firewall rule is “Never open port 3306 (default MariaDB port) to the entire internet.” Allow only that machine’s fixed IP address: Qbox’s Linux example is sudo ufw allow from 203.0.113.7 to any port 3306 proto tcp, and on Windows it creates an inbound New-NetFirewallRule for TCP port 3306 with -RemoteAddress set to that address, in PowerShell opened as administrator. MariaDB checks a login against the account’s user and host, so that machine also needs an account created for its address; MariaDB calls allowing 'root'@'%' from the internet “highly discouraged”. For HeidiSQL alone, the SSH tunnel in Step 3 gives the same access while the port stays closed.
Move a server from XAMPP or MySQL to MariaDB
Qbox’s migration basics describe this route for owners whose SELECT VERSION(); shows an old XAMPP database or MySQL:
- Back up the database as an
.sqlfile, as in the backup section. With the Database(s) boxes unticked, the file loads under any name. - Install MariaDB next to the old server. The old server keeps running. Because it already uses 3306, the installer suggests 3307 for the new one.
- Create a database on the new server and load the file. Connect HeidiSQL with Port 3307, create the database, select it, then click File and Run SQL file….
- Point FXServer at the new server. Add the port after the host in
mysql_connection_string, with the new server’s password and the new database name. - Keep the old database. Qbox’s rule: “Keep your backups until well after you go live. Don’t delete the old database or server folder.”
Moving from QBCore to Qbox at the same time is a larger job, covered step by step in the QBCore to Qbox migration guide.
A FiveM database at a game server host
- The host runs the database server. According to the Qbox docs, a game server provider’s control panel “usually has phpMyAdmin”.
- The deployer fields may be filled in already. A host can preset them, and txAdmin then shows a note that the values “were auto-filled” and that editing them is “strongly disencouraged”, in its own spelling. A preset database name becomes the default name, so Delete Database starts On for it.
- Check the version on phpMyAdmin’s start page, which shows the Server version. If it is MySQL or a MariaDB older than 10.9 and you want Qbox, the Qbox docs say to ask your host to move you to a current MariaDB.
- Use the Export tab for backups and the Import tab for
.sqlfiles.
Troubleshooting
txAdmin shows “Database connection failed” in the Recipe Deployer
The deployer logs in with the host, port, user and password from the database options before it runs any task.
- The reason contains
ECONNREFUSED. Node.js defines this code as a connection the target machine “actively refused”, usually because the service “is inactive” on that host. MariaDB is not running, or not on that port. On Windows, check theMariaDBservice; ESX’s guide says to “Check Windows Services and verify your password”. On Linux, runsudo systemctl status mariadb. With a port other than 3306, txAdmin adds “You are not using the default DB port 3306, make sure it is correct!”. Ignore the XAMPP suggestion in the Windows message. - The reason is an access error. Open Show/Hide Database options (advanced) and type the account and password. The default password is an empty one, and the default user on Linux is the socket-only
root.
“Access denied for user ‘root’@‘localhost’” on Linux
When the message has no using password part, it is MariaDB error 1698. The root account authenticates through unix_socket, and MariaDB’s reference says “A password on the command line makes no difference”. Use sudo mariadb for administration and a dedicated account for FXServer, as in Step 2.
“Access denied for user … (using password: YES)” in the server console
This is error 1045, ER_ACCESS_DENIED_ERROR. MariaDB’s reference says a wrong password, a missing password and a user name that has no account “all give the same error”. using password: YES only means that a password was sent; using password: NO means none was, which points to a connection string without a password.
- Check the account and its host. MariaDB’s advice is to check that an account exists “for the user and the host that the error message names”. Its own pages differ on one detail: the error reference says that while
skip_name_resolveis off, its default, a TCP connection to127.0.0.1is reported aslocalhost, but theCREATE USERpage says that on Linux127.0.0.1“will not match ‘localhost’”. Go by the host printed in the error and create the account for exactly that host. - Check for an anonymous account. An account such as
''@'localhost'can match a local connection before yours does, and then the login fails even with the right password. MariaDB’s fix isDROP USER ''@'localhost';ormariadb-secure-installation.
“Access denied for user … to database” or “Unknown database”
Error 1049, ER_BAD_DB_ERROR, reads Unknown database: the database name in the connection string does not exist on the server. Error 1044, ER_DBACCESS_DENIED_ERROR, means the account “has no privileges on the database it tries to use”, and MariaDB returns “the same error for a database that doesn’t exist”. With a dedicated account, a typing mistake in the database name therefore looks like a missing privilege, and so does a deployer run that kept the default deployment ID as the name. Compare the name in mysql_connection_string with the list in HeidiSQL, then check the GRANT line from Step 2.
“Foreign key constraint is incorrectly formed” when you run an SQL file
Qbox’s FAQ attributes this error to “a mismatch of collation types between the table being created and existing tables”. Its fix is to add DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; to the end of the CREATE TABLE parts of the file, and to drop and re-add the table if it already exists. The collation table in Step 2 shows where a different default comes from.
“You have an error in your SQL syntax” when you run Qbox’s SQL
Qbox relies on statements that older servers reject. Its installation page lists ADD COLUMN IF NOT EXISTS in qbx_core.sql (MariaDB 10.0.2) and CREATE INDEX IF NOT EXISTS on resource start (MariaDB 10.9.0). Qbox’s migration guide lists this error for its collation statements: check that you copied the whole block, and if you did, “your MariaDB is too old”. Check the version with SELECT VERSION();.
HeidiSQL: “Lost connection to MySQL server at ‘reading initial communication packet’”
HeidiSQL’s help says this error is mostly caused by an SSH tunnel onto the public address of the server. Use 127.0.0.1 in Settings > Hostname/IP, and the server’s remote IP in SSH tunnel > Host.
oxmysql prints “Unable to establish a connection to the database”
The code in brackets says why, for example ECONNREFUSED when nothing accepted the connection on the host and port in mysql_connection_string. oxmysql’s common issues list, which the error message links to, calls this “an incredibly generic error” and starts with three checks: the connection string is configured correctly, the database “exists and is running”, and the string has no reserved characters. The ECONNREFUSED guide goes through each cause.
Next Steps
- Set the remaining options of the connection line with the oxmysql connection string guide.
- Fix connection errors that remain with the oxmysql ECONNREFUSED guide.
- Deploy a framework on the new database server with the txAdmin recipe guide.
- Add resources to the server with the script installation guide; FiveCrate’s own resources are listed under FiveM scripts.
FiveM scripts from FiveCrate
Listed in the FiveCrate catalogue now.
Official documentation and repository references
- Qbox Docs: Installation (MariaDB version requirements)
- Qbox Docs: Migration basics (HeidiSQL, backups, database server check)
- Overextended Docs: oxmysql
- ESX Docs: Installing ESX Legacy
- txAdmin source: Recipe Deployer database check and connection string
- MariaDB Foundation: Download MariaDB Server
- MariaDB Docs: Installing MariaDB MSI Packages on Windows
- HeidiSQL: Help
Related guides
Fix connect ECONNREFUSED 127.0.0.1:3306 in FiveM oxmysql
connect ECONNREFUSED 127.0.0.1:3306 means nothing accepted oxmysql on port 3306. Start MariaDB, check its port and bind address, then fix the connection line.
oxmysql Setup: mysql_connection_string Explained
Set mysql_connection_string for oxmysql 2.14.3: both formats, password characters, set vs setr, pool options, slow query warnings, debug convars and fixes.
How to Install FiveM Scripts and Resources Safely
How to install FiveM scripts: check the files, put the folder in resources, add its dependencies and SQL, then set the ensure order in server.cfg.
QBCore vs ESX vs Qbox: Which FiveM Framework in 2026?
QBCore vs ESX vs Qbox in 2026, from official sources: what QBCore leaving FiveM means, how Qbox and ESX Legacy differ, and which framework fits your scripts.
txAdmin Recipes Explained: Deploy Qbox, ESX or Default
How a txAdmin recipe builds a FiveM server: the current Popular Recipes list, each deployer step, database options, custom URLs and the QBCore deprecation.


