Connect FiveM resources to a private database with oxmysql
oxmysql is the database adapter used by many FiveM resources. It does not create a managed database account or automatically install your framework's schema. You need the database hostname, port, database name, username and password supplied for your service. Use an account limited to your own game database, never a shared database administrator account.
Choose a release honestly
Overextended and CommunityOx have both had archival changes. CommunityOx's organisation and oxmysql repository are archived as of this guide's November 2026 check. Its installation documentation remains useful historical reference; it is not evidence of active maintenance. Use the release and download origin currently recommended by your framework's official recipe, record the exact version, and check compatibility before switching forks. Do not choose a similarly named download site because it ranks first in search.
Before changing the adapter, back up the resource files and export the matching database. Preserve the existing working connection configuration privately. If an upgrade needs migrations, read those migrations before running them. Do not import a starter schema over production tables.
Set the connection before resources start
Install the built release as the resource name oxmysql. In the active server configuration, use the adapter's supported connection format. This template deliberately contains placeholders and cannot connect until you replace them:
set mysql_connection_string "user=DB_USER;password=DB_PASSWORD;host=DB_HOST;port=DB_PORT;database=DB_NAME"
ensure oxmysql
ensure example_framework
Keep this a private set, not setr or a public server-listing value. The database address must be reachable from the game container. localhost means that container's own network context; it is usually wrong for a separately hosted database. Use the endpoint CloudExa supplies, including a non-default port if one was assigned.
Reserved characters need the format and escaping supported by your selected adapter release. Never weaken a password or publish a connection string to get past parsing trouble. If a secret was exposed in a log or screenshot, rotate it and update the active configuration.
Read the first failure
- Timeout or refused connection: check the exact hostname and port, service availability and whether the game server's source is allowed. Ask support to check the narrow network path; opening the database to everyone is unnecessary.
- Access denied: check credentials and the database account's permitted source host. The same password working from your home PC does not prove the container is authorised.
- Unknown table or column: the connection probably reached SQL; check the resource's schema and migration version.
- Missing export: verify resource name, release compatibility and startup order before changing SQL.
Verify persistence
After startup reports a successful connection, test one normal framework action that writes data. Reconnect and verify that change remains. Use a read-only query through your authorised database tools if needed. Avoid enabling full query logging permanently: queries can contain personal information and create heavy logs. Save the first redacted error, adapter release and framework version if you need support.
Related guides
Further reading
- Historical oxmysql project installation reference
- CommunityOx archive status
- oxmysql repository and release history
- MariaDB account host matching
Looking for another game? Browse game server setup and troubleshooting guides.
No comments to display
No comments to display