Articles on: FiveM

How to Setup Your Database on Your FiveM Server

Guide: How to Setup Your Database on Your FiveM Server

Welcome to our tutorial where we'll walk you through setting up a database for your FiveM server.

1. Access the GamePanel:
- Open your web browser and navigate to the GamePanel.
- Log in to your account.

2. Navigate to Databases:
- Once logged in, locate and click on the Databases tab.

Databases Tab

3. Create a New Database:
- If you don't have a database yet, click on the New Database button.

New Database Button

4. Provide Database Details:
- Enter your preferred name for the database in the Database name field.
- Leave the Connection From field empty to allow all connections to your server.

Database Name

5. Confirm Database Creation:
- Click on Create Database to confirm the creation of your new database.

Create Database

6. Access Server Files:
- Right-click on the Files section to access your server files.

Files Tab

7. Edit Server Configuration:
- Locate and click on your current server.cfg file to open it.
- Add the MySQL connection string to your server.cfg file, replacing the placeholders with the actual values from the databases created in the GamePanel.

Examples:
set mysql_connection_string "mysql://databaseuser:databasepassword@endpoint:3306/databasename"

set mysql_connection_string "user=databaseuser;password=databasepassword;host=endpoint;port=3306;database=databasename"

Database Resources:
- oxmysql: https://github.com/overextended/oxmysql
- ghmattimysql: https://github.com/FrazzIe/ghmattimysql
- mysql-async: https://github.com/brouznouf/fivem-mysql-async

Need Help?

Should you require further assistance, don't hesitate to reach out to our support team at: FREAKHOSTING Support.

Updated on: 22/05/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!