Database · brouznouf

mysql-async for FiveM

What it is

The original FiveM MySQL wrapper: still installed on a very large number of live servers, no longer the right choice for new code.

mysql-async was the database layer for the first generation of ESX servers, and its API — MySQL.Async.fetchAll, MySQL.Sync.execute — is written into thousands of published scripts. It still works. It is also unmaintained, slower than oxmysql and easier to write an injection bug against, which is why every current recommendation points elsewhere.

Official documentation Repository All resources

At a glance

Maintainerbrouznouf
Latest release3.3.2 · 2020-07-19
Last code change2023-03-06
LicenceMIT
Written inJavaScript
GitHub stars113
StatusActive

Figures read from the repository on 2026-09-22.

Why servers run it

  • Enormous installed base: most ESX scripts written before 2022 call it directly.
  • The API is simple and well understood, which is why it lasted.

Installing mysql-async

  1. 1. Prefer the oxmysql shim

    Rather than installing mysql-async itself, run oxmysql with its mysql-async compatibility layer enabled. Old scripts keep working, new ones get prepared statements.

  2. 2. If you must install it

    Set mysql_connection_string in server.cfg and start it before anything that queries.

Working examples

The legacy API you will meet in old scripts

MySQL.Async.fetchAll('SELECT * FROM users WHERE identifier = @identifier', {
    ['@identifier'] = identifier
}, function(result)
    if result[1] then print(result[1].name) end
end)

-- The oxmysql equivalent
local result = MySQL.query.await('SELECT * FROM users WHERE identifier = ?', { identifier })

What goes wrong

Unmaintained. No security fixes.

Named parameters, not question marks. Mixing the two styles while migrating is a common source of silent empty results.

Running it alongside oxmysql means two pools competing for connections.

mysql-async — questions people ask

Do I need mysql-async if my scripts use it?
No — oxmysql's compatibility layer answers the same calls. Install oxmysql, enable the shim, and drop mysql-async entirely.

Runs alongside

oxmysql

The MySQL wrapper the modern FiveM stack runs on: promise-based, prepared-statement aware and a drop-in replacement for mysql-async.

es_extended (ESX Legacy)

The original FiveM roleplay framework, still running a very large share of live servers — jobs, money, society accounts and a huge script catalogue.