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.
Before starting, make sure you have:
- A FiveM server running the latest recommended build.
oxmysqlinstalled in your resources folder.- Access to your MySQL or MariaDB database.
- A database user dedicated to your FiveM server (recommended).
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 oxmysqloxmysql 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| 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.
Restart your FiveM server.
If the connection works, you should see:
[oxmysql] connection establishedIf 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.