Create a database
This guide explains how to create a database for your FiveM server.
Via the YorkHost Panel
- Log in to your YorkHost Panel:
- Select your FiveM server
- Go to the Databases tab
- Click New database
- Give your database a name (Database Name)
- Click Create Database
Retrieve information
After creation, you will get:
- Address: MySQL server address and connection port (usually 3306)
- Database: database name
- Username: username
- Password: click the eye (Show password) to see it
The Connection string block also offers a ready-to-paste string in the oxmysql (FiveM) format: the password is included when copied. The Open phpMyAdmin button opens the database in phpMyAdmin.
Configuration in server.cfg
Add the connection in your server.cfg:
set mysql_connection_string "mysql://USERNAME:PASSWORD@HOST:PORT/DATABASE?charset=utf8mb4"
Replace the values with those obtained previously.
Test the connection
To verify that the connection works, you can use a MySQL client like HeidiSQL or phpMyAdmin.
warning
Never share your database credentials.