Articles on: FiveM

Connect your server to a database

In this tutorial we will show you how to connect your server to a database using ESX. Other resources/frameworks might require a different configuration. Always read the documentation if your resource.

First make sure you have created the database and imported all SQL files that where included with your resources!

Open your server.cfg (How to use WinSCP)
Add this on top of your server.cfg:

set es_enableCustomData 1
set mysql_connection_string "server=HOST;uid=USERNAME;password=PASSWORD;database=DBNAME"




Change the parameters.
- Replace HOST with your database IP.
- Replace USERNAME with your database username
- Replace PASSWORD with your database password
- Replace DBNAME with your database name

Save the file.
Restart your server.

Find your database credentials


In your control panel go to databases in the menu.

How to find your database name
How to find your database user: Click on the eye button
How to find your database password: Click on the eye button
How to find your database IP/host: Click on the eye button

Updated on: 02/11/2020

Was this article helpful?

Share your feedback

Cancel

Thank you!