Lightweight database middleware for FXServer which utilises node-mysql2 to communicate with a database and respond with the query results.
Features
Improved performance and compatibility with Lua wrapper
Resolves issues when using MySQL 8.0
Returns callbacks immediately, removing up to 50ms overhead
UI utility for easy query statistics
Note that UI is useful for quickly checking stuff while in game and developing but do not use it in production!
Installation & Usage
Common issues
Unable to establish a connection
This is usually the result of incorrect database settings or your password containing reserved characters (typically ; , / ? : @ & = + $ # ).
Ensure you have entered the correct database settings in the mysql_connection_string convar. You can try using the semicolon-separated format if your password contains reserved characters.
No such export … in resource oxmysql
Typically the result of failing to follow instructions.
Download the latest release build (not source) of oxmysql, and ensure it is starting before any resources that require it.
Before reporting any issue, please go trough documentation first!
Hey, So I only started playing around with dev-ing with the SDK yesterday, and used this module, with ox-inventory. I quickly found it was using the same mysql_connection_string as mysql-async/node-mysql, which meant I can’t mix and match modules, as obviously, this is so new that other modules haven’t switched to it yet.
Any ideas on how I could work around this? At this point I’m just playing with modules and seeing what works nicely with each other.
mysql-async is just ghmattimysql behind the scenes and both support the URI style string.
set mysql_connection_string "user=root;database=es_extended;password=password"
is instead formatted as set mysql_connection_string "mysql://root:[email protected]/es_extended?"
For a noob who is interested in increasing performance, can you explain what I would need to change if I’m currently using MySQL-async? Would this just run alongside it or replace it? Would I need to change any scripts to work with it?
This resource provides exports instead of importing script into every resource fxmanifest.
If you want to use this instead of mysql-async you will have to change every line of mysql-async query code to oxmysql export and remove mysql-async from fxmanifest.
To be honest I would first try this resource on development server to see if all queries are compatible.