THE ORB
Starting the studio

No such export fetchAll / execute in resource mysql-async

A script was written for an older database system than the one you have installed.

groupsThat script does nothingpersonYou can fix this

Do this first

Either install the version the script expects, or ask the seller for an updated one.

bug_reportPaste your whole console instead

What it means

A script is calling the API of a database resource that is not the one you have installed. FiveM has been through three of them — mysql-async, then ghmattimysql, now oxmysql — and scripts written for one call exports the others do not have.

What causes it

Ordered by how often it is the answer.

  1. 1

    The script wants mysql-async and you run oxmysql

    oxmysql ships a compatibility layer, but it has to be enabled and it does not cover everything.

  2. 2

    The old resource is installed but not started

    Present in the folder, missing from server.cfg.

  3. 3

    Two database resources at once

    Both installed, each half-configured, and scripts split between them.

  4. 4

    An export that never existed

    fetchSync was ghmattimysql's; fetchAll was mysql-async's. Neither is oxmysql's native API.

How to tell which one is yours

print(GetResourceState('oxmysql'), GetResourceState('mysql-async'))

Then grep the failing script for which API it uses:

grep -rn "MySQL\.\|exports\['mysql-async'\]\|exports.oxmysql" my-script/

Where to look

The script's database calls, and which database resource server.cfg starts.

How to fix it

Standardise on oxmysql and turn on the compatibility layer for old scripts:

# server.cfg
set mysql_connection_string "mysql://user:pass@host/db?charset=utf8mb4"
ensure oxmysql

# only if you still run scripts written for the old APIs
set oxmysql_slow_query_warning 200

For a script you can edit, port the call:

-- mysql-async
MySQL.Async.fetchAll('SELECT * FROM users WHERE identifier = @id', { ['@id'] = id }, cb)

-- oxmysql
MySQL.query('SELECT * FROM users WHERE identifier = ?', { id }, cb)

Still stuck on your own code?

This page is what this error usually means. Paste your console into Server Fixer and it will rank everything in it and tell you what to do first, and if you would rather not touch it, ORBIE can repair the script and hand the resource back ready to drop in.

bug_reportOpen Server Fixer

Errors that travel with this one