Skip to content

This article explains how to configure a secure MySQL connection string for a FiveM server in 2025 using oxmysql, compatible with the Pterodactyl panel password format.

Notifications You must be signed in to change notification settings

PoretQuentin/How-to-Set-Up-MySQL-Connection-in-FiveM-2025-Using-oxmysql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 

Repository files navigation

How-to-Set-Up-MySQL-Connection-in-FiveM-2025-Using-oxmysql

This article explains how to configure a secure MySQL connection string for a FiveM server in 2025 using oxmysql, compatible with the Pterodactyl panel password format.

✅ Requirements

Before starting, make sure you have:

  • A FiveM server running the latest recommended build.
  • oxmysql installed in your resources folder.
  • Access to your MySQL or MariaDB database.
  • A database user dedicated to your FiveM server (recommended).

1. Installing oxmysql

Download the latest version from GitHub : https://github.com/overextended/oxmysql

Place the folder in:

resources/[ox]/oxmysql

Then add this line in your server.cfg:

ensure oxmysql

2. Setting the MySQL Connection String (2025 Format)

oxmysql uses a modern URL-style connection string.

Then, add this line at the beginning of your server.cfg.

set mysql_slow_query_warning 150
set mysql_connection_string "mysql://database_user:database_password@database_host:3306/database_name?charset=utf8mb4"
set mysql_debug 0

Breakdown of the Connection String

Key Description
database_user Your MySQL username
database_password Your MySQL password
database_host Your database IP or domain
3306 Default MySQL port
database_name The database the server should use
charset=utf8mb4 Required for emojis and special characters

This format is the recommended way for oxmysql in 2025.


3. Testing the Database Connection

Restart your FiveM server.
If the connection works, you should see:

[oxmysql] connection established

If not, check:

  • Wrong username/password
  • Incorrect database name
  • Firewall blocking port 3306
  • MySQL user not allowed to connect remotely
  • Missing permissions (SELECT, INSERT, UPDATE, DELETE…)

This article is made with an ai for the correction.

About

This article explains how to configure a secure MySQL connection string for a FiveM server in 2025 using oxmysql, compatible with the Pterodactyl panel password format.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published