Skip to content
CyberNex Logo
Back to Tutorials
FiveM3 min readJuly 15, 2026

Connect your server to a database

Ganidu Sathishka
Support Engineer at CyberNex | 4+ years customer technical support

Overview

Most frameworks (ESX, QBCore, etc.) store their data in MySQL. Other resources may require a different configuration - always read the resource documentation.

Step-by-Step Instructions

<ol><li>Create a database and import all the SQL files that came with your resources first.</li><li>Open server.cfg.</li><li>Add the mysql_connection_string at the top of the file.</li><li>Replace HOST, USERNAME, PASSWORD and DBNAME with your real values (found under Databases in the panel).</li><li>Save the file and restart your server.</li></ol>

Code / Configuration

<pre><code>set mysql_connection_string "server=DB_HOST_IP;uid=DB_USER;password=DB_PASS;database=DB_NAME"</code></pre>

Watch the database IP

Use the IP from the Databases tab, never 127.0.0.1. A wrong IP causes the ECONNREFUSED error.

Related Hosting Services
// Frequently Asked Questions

FAQ

Was this guide helpful?

Join our Discord for more guides and direct help from our engineering team.

Connect your server to a database | CyberNex