FiveM oxmysql Connection String Builder

Build the mysql_connection_string for the oxmysql resource — required by QBCore, ESX, and most modern FiveM frameworks. Add the result to your server.cfg before ensuring oxmysql.

Database Connection

200 ms

oxmysql_slow_query_warning — log queries slower than this (recommended: 200ms)

server.cfg — mysql:// format

set mysql_connection_string "mysql://fivem_user:@@127.0.0.1:3306/fivem_db"
setr oxmysql_slow_query_warning 200

Recommended for oxmysql v2.5+. Add this block before any ensure oxmysql line.

Alternate: mysql2:// format

set mysql_connection_string "mysql2://fivem_user:@@127.0.0.1:3306/fivem_db"

Use mysql2:// only if you are running an older oxmysql version that requires it. Most servers should use mysql:// above.

Setup Tips

  • •Always place set mysql_connection_string above your first ensure oxmysql in server.cfg.
  • •If running MySQL on the same machine as FiveM, use 127.0.0.1 not localhost — MySQL may resolve these differently.
  • •Special characters in passwords (e.g. @, #) must be URL-encoded — @ becomes %40. Consider using a password without special chars to avoid issues.
  • •Check the FiveM server console for [oxmysql] Database server version on startup to confirm the connection succeeded.
Private FiveM hosting

Run your own FiveM server.

Rent a private FiveM server on real hardware — full control-panel access, your mods, your configs, your rules. It's your server; run it your way.

Rent a FiveM server Real hardware · Full control panel · 98% SLA

Don't want to run it yourself? Our managed services & consulting team will set it up and keep it running for you — game servers, Windows, Linux, and cloud, from 10+ years of MSP work.