Back to Game Hosting
Game Hosting

Connecting a Database to Your FiveM Server

Learn how to set up and connect a MySQL database to your FiveM server with oxMySQL

5 minutesFebruary 25, 2026

Most FiveM frameworks and resources require a MySQL database to store player data, inventory, vehicles, and more. This guide will show you how to set up and connect a database to your FiveM server.

Prerequisites

Before starting, you need:

  • A FlexyNode FiveM server
  • A MySQL database (included with FlexyNode game hosting)
  • oxMySQL installed

Step 1: Create Your Database

Via FlexyNode Game Panel

  1. Log in to your FlexyNode game panel
  2. Navigate to your FiveM server
  3. Click on Databases in the left menu
  4. Click Create Database

Databases Create Database

  1. Fill in the details:
    • Database Name: Choose a name (e.g., fivem_server)
    • Remote Access: Enable if you want to connect from outside (optional)
  2. Click Create Database Creation

Database Credentials

After creation, click on the following button to show the database crendentials: Database Crendentials

Click on "rotate password" until all special characters unless ! or . are removed from the password. Numbers and capital letters are allowed. Rotate Password

Click on the "JDBC Connection String" field to copy the JDBC database string. JDBC Connection String

Server Configuration

Go to your server files via the "Files" button in the sidebar and open your server.cfg file. Server Configuration

In your server.cfg file, add: set mysql_connection_string "putyourstringhere" to the beginning of the file and replace putyourstringhere with the JDBC database string that you copied earlier. Server CFG Database Line

Remove JDBC: before the mysql:// and click on "Save Content" to save the file. JDBC Removed

Start Server

Click on the "Console" button in the sidebar and start your server. If everything went well, you will now receive a message that oxmysql has been successfully connected. Start Server

Success

Your database has now been successfully connected!

Framework Documentation

FlexyNode Support

Need help with your database setup?

Good luck with your FiveM server! 🎮💾

Was this article helpful? Let us know at [email protected]