set mysql_connection_string line into server.cfg above your ensure lines, or into txAdmin’s recipe, and restart.
Before you start
- You only need a database for frameworks such as QBCore, Qbox or ESX, or for scripts that save data. vMenu and plain servers don’t need one.
oxmysqlmust be installed. Framework recipes in txAdmin include it.
How to create a FiveM database
1
Open Databases
Open your server in the Game Panel and click Databases in the sidebar.
2
Create the database
Click Create database. Enter a name, for example
fivem. The dialog shows the full name it will get, with a prefix. Leave Allowed to connect from on Anywhere and click Create database.3
Show the password
On the new database card, click Show next to PASSWORD. The card shows HOST (port
3306), DATABASE, USER NAME and PASSWORD, each with Copy.4
Copy the oxmysql line
Under FORMAT, choose FiveM (oxmysql) and click Copy. The card writes the full line with your details filled in.
How to add the connection string to server.cfg
1
Open the raw file
Click Server config under FIVEM, then Advanced: open the raw file.
2
Paste the line
Paste the copied line above your
ensure lines. Remove any older mysql_connection_string line. It looks similar to this:3
Start oxmysql first
Make sure
ensure oxmysql comes before your framework and scripts:4
Save and restart
Save the file and restart the server.
Using a txAdmin recipe? Paste the host, user name, password and database name from the card when the recipe asks for them. txAdmin writes the line for you. See how to install QBCore or ESX.
oxmysql connection string formats
oxmysql accepts two formats. Use onlyset, as the oxmysql documentation says:
Frequently asked questions
How do I import a script’s .sql file?
Click Open in phpMyAdmin on the database card, or use HeidiSQL. See how to import an SQL file with HeidiSQL.Why does oxmysql say it can’t connect?
Copy the line again from the card, check that it is above theensure lines and that oxmysql starts first. If you clicked Rotate password, the old password stops working right away; copy the new line.
Are FiveM databases included in backups?
Make your own copy before big changes: export the database in phpMyAdmin or HeidiSQL. Deleting a database removes all its data, and no backup of the database is kept.How many databases can I create?
The Databases page shows how many you use and how many your server allows.Related guides
FiveM server guide
Every FiveM guide in one place.
Import SQL with HeidiSQL
Run a script’s .sql file.
Install QBCore or ESX
Frameworks that need a database.
Resource start order
Start oxmysql before your framework.
Manage databases
Every option on the Databases page.
Tested by the FREAKHOSTING team on our Game Panel on 29 October 2026 (FXServer build 35245 (Recommended) with txAdmin). Formats checked against the oxmysql documentation.
Need Extra Help?
If you encounter any issues, our support team is ready to assist:- Live Chat: Quick assistance via our website.
- Support Ticket: Open a Ticket
- Discord: Join our Community
- Email: support@freakhosting.com
Last Updated: October 2026