Ghmattimysql: My MySQL Implementation for FiveM [1.3.2]

Im running this with E S X and not having any issues. Great resource!

2 Likes

am I doing something wrong??I don’t understand what he asks from me do be honest.

Why do you think you are doing something wrong? I don’t see any error in that screenshot. Those hitch warnings are common due to the resource creating a connection with mysql

When I go in the game I can’t see game hud.I’m using ESX and if I try to do /setjob it will give me errors with es extended not sure why.Do I need to use esmysql as well to make it work or I’m doing something wrong.

I have no idea. I have however seen many issues recently with the esx resource and /setjob. I don’t know how it functions and I don’t know the cause.

Best is to forward this issue to whatever resource is responsible for that command. This is the GHMattiMySQL forum topic and has nothing to do with Esx.

Probably the error that is related the the known issues.

From my point of view use mysql-async the author of this GHMatti is currently the on releasing updates to that to, so my guess is he migrated the optimization to mysql-async to be honest :wink:

No. I did not; because they are kinda incompatible.

mysql-async is better suited for 1-4 cores on your server. GHMattiMySQL is better suited for 4 and more core servers. On a four core server it highly depends how you are using your MySQL database on which MySqlConnector wrapper to pick.

GHMattiMySQL is basically mysql-async’s Threaded option in better and multithreaded. mysql-async, can do with proper backend writing maybe 200 queries per second before not being able to handle requests anymore properly. Which seemed to be roughly core-count independent in my stress tests.

So if you are going for heavy mysql use on a 4+ core server, you should be using GHMattiMySQL. Otherwise mysql-async will do.

How do i include the C# library in my project? Im new to using C# like this, and i am adding a reference to the DLL’s provided but im not getting any of the functionality?

Two choices

  • Pick the C# Library, which is a wrapper for a wrapper and use it similarily to how this file does it.
  • Use the resource and lazily use the exports. Thus losing a bit of control, but maybe gaining some comfort.

Just wondering the onMysqlReady is there a method for it to trigger of you restart a resource, got a ban system but if reload it, it wont load the bans because of the onMysqlReady trigger og Mysql.ready for that matter.

so just wondering if there is a method to trigger it.

The best way around it is to use the exports provided by the resource :wink:

Can I directly call the C# functions from another resource? Or does it need to be a dll inside the same resource? Because from another resource it doesn’t seem to work for me, maybe something special I need to put into __resource.lua? Help would be greatly appreciated

Oh I should have answered. I am terribly sorry. You just start the resource, and can call the functions from any resource via the exports.

Not sure if this is the right place to ask the following question, but I’ll try.

So when I try to run this resource (on freshly installed/configured server with just default resources running) it seems like it can’t load the next .dlls:

  • System.Buffers.dll
  • System.Threading.Tasks.Extensions.dll

Looks like it just hangs up on trying to load them, this is what I get in the server console:

https://gyazo.com/d97dadfa3509d41d3ca8fca09ad95ee0

Nothing else happens later, it just stays like that. It did successfully load the MySqlConnector.dll though as you can see. Obviously if I try to use any exported function, the resource I called the exported function from also hangs up.

By the way the same thing happens when I try to start mysql-async (which is also using those mentioned .dlls) so the problem is clearly on my side, but I don’t know where to start digging to solve this issue. The server is running on Windows 10 machine with latest .Net framework runtimes installed if that matters.

I’d really appreciate it if anyone could help me solve the issue.

Hello, every time player is getting connected my whitelist plugin calls this code.

local result = exports["GHMattiMySQL"]:QueryScalar("SELECT whitelisted FROM user_whitelist WHERE identifier = @username AND whitelisted = 1", {['@username'] = identifier})

But after that i get this error

In my DB seems everything OK. Exact table with exact column is really existing

image

Can someone help me with this issue please?

SELECT whitelisted FROM user_whitelist WHERE identifier = @username

try this query instead by taking away the WHERE clause for whitelisted

Nope, still same. :frowning:

I am not even sure if it is related to the implementation at all.

Also I am very likely moving away from mysqlconnector for both mysql-async and ghmattimysql.

@MrStiletto Have you tried any other release version?

2 Likes

Updated to use a node.js based connector. This is a beta leading to 1.0.0, and not a final release. Switched repositories.

2 Likes