Skip to content
Vice Drip
FiveM answers

What is oxmysql in FiveM?

oxmysql is the database connector most FiveM servers run: a resource that gives scripts an asynchronous, parameterized interface to a MySQL or MariaDB database. It replaced older connectors such as mysql-async and ghmattimysql, is required by Qbox and used by current QBCore and ESX builds, and exposes functions for queries, single-row reads, inserts, updates, and transactions. A script that talks to the database any other way in 2026 deserves scrutiny.

In one lineoxmysql is the ox ecosystem's FiveM resource for asynchronous, parameterized MySQL and MariaDB access, and the de facto standard database layer across modern frameworks.

The longer answer.

Every persistent thing on a roleplay server — characters, money, vehicles, properties, inventories — lives in a database, and oxmysql is the pipe between Lua and that database. It exposes a small API for the common shapes of work: run a query, fetch one row, fetch one value, insert and get the new ID, update and get the affected count, and run several statements as one transaction. Frameworks and scripts alike call it through exports, which is why almost every server.cfg ensures it near the top.

Two of its properties are the ones that matter for a buyer. First, calls are asynchronous: a slow query does not freeze the server thread, so a database hiccup degrades one feature rather than the whole city. Second, queries are parameterized: values are passed separately from SQL text, which is the standard defence against injection and the reason string-building SQL in a script is disqualifying. Both properties are only as good as the calling script — oxmysql offers transactions, but a banking script has to use them for a transfer to be atomic.

It shares the ox lineage with ox_lib and ox_inventory, so its maintenance status is worth checking on GitHub before a new deployment, and it needs the database itself to be reachable and correctly configured through the `mysql_connection_string` convar in server.cfg. A large share of "the script is broken" reports on fresh servers are actually a wrong connection string or a schema that was never imported — check both before blaming the resource.

Go deeper

Where this is covered in full.

Related questions

People asking this also ask.

Next

Where to go from here.

Published 2026-09-06 · Last reviewed 2026-09-06 · Vice Drip · All answers