Installation
Swap out your old database resource for waw-sql in four steps. Your scripts and your connection string stay as they are.
Install
After you buy waw-sql it is in your Cfx.re account. Sign in at portal.cfx.re with the account you bought it with, open Assets → Granted Assets and download waw-sql. Unzip the download: inside is the waw-sql folder.
- Stop the server.
- Delete your
oxmysqlresource folder completely. It is usually inside a folder in brackets, such as[standalone]or[ox]; search yourresourcesfolder foroxmysqlif you can't find it. Keep a copy somewhere outsideresourcesif you want to be able to go back. - Copy the
waw-sqlfolder into yourresourcesdirectory (or into one of the bracket folders in it). Keep its namewaw-sql. - Keep your existing
mysql_connection_stringconvar. No other change is needed.
You don't need to ensure waw-sql yourself: anything that depends on oxmysql starts it automatically.
If you have no database yet, or don't know what goes into mysql_connection_string, read Connecting your database first.
waw-sql takes over the oxmysql name, so the old folder has to be gone, not just left out of server.cfg.
Check that it runs
Start the server. In the server console (the server's own window, or Live Console in txAdmin) you should see:
[waw-sql] oxmysql compatibility enabled: ...
[waw-sql] Connected to 10.x.x-MariaDB (pool 20, 20 connections ready)Then join the game and type /sqlmenu. Admins in the god or admin group can open it straight away. If you can't, make yourself an owner as described in Who may do what.
Why your scripts keep working
waw-sql declares itself as oxmysql, so all of these keep working without any change:
dependency 'oxmysql'entries@oxmysql/lib/MySQL.lualinesGetResourceState('oxmysql')checksexports.oxmysql,mysql-asyncandghmattimysqlcalls
Exports, the Lua library, placeholders, type conversion, transactions and error behaviour follow oxmysql 2.x. All releases from v1.0.0 to v2.14.1 were reviewed, and the same test suite of 117 cases produced identical output on oxmysql 2.12 and waw-sql inside FiveM.
What is different
- DATETIME values at exactly midnight read through
prepareorrawExecutecome back as local time, the same asqueryreturns them. oxmysql returned them shifted by the server's UTC offset. - The in-game
/mysqlscreen is replaced by the/sqlmenupanel.oxmysql_debug add|remove <resource>still works. - Error messages are worded differently. The database's own error text is included unchanged.
restart waw-sqlstops every resource that depends on it, the same as with oxmysql. Start them again, or restart the server.- Under the
oxmysqlname waw-sql answers every oxmysql export and its own additions (cache, queue, schema versions, the exports for other scripts), but not the panel's internal exports.
Going back
If you turned on the audit log, press Stop on each audited table first, so its triggers are removed. Then stop the server, delete the waw-sql folder and put your old oxmysql folder back.
