Connect your server to a database

FiveM1 min readUpdated Aug 28, 2026

Frameworks like ESX and QBCore, and most scripts that save anything, need a MySQL database connection. The panel generates the connection string for you, and the server.cfg Editor fills itself in when you paste it.

Before you start, make sure you have created a database and imported the SQL files that came with your resources.

Copy the Connection String

  • In the game panel, open your server and click Databases under MANAGEMENT.
  • On your database card, press the Connection string button. A window opens with the ready-made string in several formats; copy the URI at the top. It contains the host, port, username, password and database name in one line.

Paste It into the server.cfg Editor

  • Click server.cfg Editor under GAME SERVER and scroll to the Database section on the Settings tab.
  • Paste the copied string into the Host field. The editor recognizes it and autofills Host, Port, Username, Database and Password in one go.
  • Below the fields, the Connection string format switch lets you pick key=value or URI. oxmysql accepts both; some older resources such as mysql-async expect key=value. Check your resource's documentation if you are unsure.
  • The Generated connection string preview shows exactly what will be written to server.cfg (the password stays masked).

Save and Restart

  • Press Save changes at the top of the page.
  • Restart your server from the Console page so the new connection string is loaded.

Finished

Your server is now connected to the database. If a resource still complains about the database, watch the console during startup: a wrong password or database name shows up there as a connection error. Need to load more SQL files later? Follow the HeidiSQL import guide.

Did this solve your problem?

Still stuck?

Our support team actually knows the games we host. Open a ticket and we will figure it out together.

Open a ticket