Skip to main content

Create a database

This guide explains how to create a database for your FiveM server.

Via the YorkHost Panel​

  1. Log in to your Game Panel:
  2. Select your FiveM server
  3. Go to the Databases tab
  4. Click New Database
  5. Give your database a name
  6. Click Create Database

Retrieve information​

After creation, you will get:

  • Host: MySQL server address
  • Port: Connection port (usually 3306)
  • Database: Database name
  • Username: Username
  • Password: Password (click the eye to see it)

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.