Ghmattimysql: My MySQL Implementation for FiveM [1.3.2]

Hi im trying to intall Ghmattimysql but it keeps give me this error could you help please Thanks
here is the error

and the config file

Are you sure your MySQL server is running on port 5984? By default it runs on 3306

im using couchDB

Ghmattimysql is, as the name, title and description says, for MySQL and not compatible with CouchDB.

would there be a way to get it to work with couchDB?

because its needed for the police script

Literally impossible. This is meant to connect to your MySQL server, not CouchDB. If you want to have a wrapper for CouchDB, you’ll have to create it yourself as I don’t think one exists for FiveM (except essentialmode’s integration)

so i have just installed mysql ans got essencial mode on it will it auto use that instead of couch db if i delete couch db?

still getting this error and i have moved over to mysql + essentiul mode isnt reading the mysql and i have put the details in correct

You would have to consult essentialmode. I don’t know how to switch to MySQL with that. Keep in mind that you may not be able to move data

wrong, you have made the decision not to update the police script to the latest version (which requires mysql instead couchdb) CouchDB was used in a very old version of Cops_FiveM.

Edit
Resolved in Ghmattimysql: My MySQL Implementation for FiveM [1.2.1]

Does anyone have any real performance metric about this vs mysql-async. I am thinking about converting our current essential mode code to work with this if it is faster but it would be a huge task. Not sure if it is really worth it to transfer all the statements over.

help plz?

Hello, i installed this following the steps - i also tried the discord server, which was no help they just sent me here; i installed the script and set up my DB information however i keep getting this error - any and all help is appreciated TIA

Hello there!!! so… trying to use it on c# someone has some clues of how? i’m trying with Newtonsoft.Json to serialize the result of execute queries and when i deserialize objects i get “unable to get assembly on json”… to get a better understanding… what kind of type is the query output ?

Anyone able to help with the following statement as I cant get it to update value in the table.

exports.GHMattiMySQL:execute('update roleplay_users set BusXP = BusXP + @addXP where License = @license', {['@addXP'] = addXP,['@license'] = playerLicense})

Should take the current BusXP then add the new XP to it. The statement prints out correctly just not actually updating the table and giving no errors?

Have you figured anything out regarding this? I’m running into a similar issue with figuring out what “array” is being returned from the SELECT query. In the documentation he mentions that a SELECT query returns “an array containing the rows of the statement”, but I can’t seem to be able to pull that information correctly.

Here is a snippet of the code I’m using for testing. The INSERT query works fine, but I’m definitely not accessing the returned data properly. Anyone have any ideas on what I’m doing wrong? I’m sure it’s obvious, but any outside perspective would be appreciated.

                        dynamic result = null;
			//Exports["ghmattimysql"].execute("INSERT INTO users (id, identifier, license, money, name, skin, job, job_grade, loadout, position, bank, permission_level) VALUES (5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5)");
			Exports["ghmattimysql"].execute("SELECT money FROM users WHERE id=2", result);

			Thread.Sleep(5000);

			TriggerClientEvent("chat:addMessage", new
			{
				color = new[] { 255, 255, 255 },
				args = new[] { "[CheckLicense]", $"Player pulled from database: {result}" }
			});

Thanks! :slight_smile:

sorry… i have not yet figured out :frowning:

can someone help me fix this ?

[vRP] DB driver “ghmattimysql” not initialized yet (39 prepares cached, 5 queries cached).
[vRP] DB driver “ghmattimysql” not initialized yet (39 prepares cached, 5 queries cached).
[vRP] DB driver “ghmattimysql” not initialized yet (39 prepares cached, 5 queries cached).
[vRP] DB driver “ghmattimysql” not initialized yet (39 prepares cached, 5 queries cached).
[vRP] DB driver “ghmattimysql” not initialized yet (39 prepares cached, 5 queries cached).
[vRP] DB driver “ghmattimysql” not initialized yet (39 prepares cached, 5 queries cached).
[vRP] DB driver “ghmattimysql” not initialized yet (39 prepares cached, 5 queries cached).
[vRP] DB driver “ghmattimysql” not initialized yet (39 prepares cached, 5 queries cached).
[vRP] DB driver “ghmattimysql” not initialized yet (39 prepares cached, 5 queries cached).
[vRP] DB driver “ghmattimysql” not initialized yet (39 prepares cached, 5 queries cached).
[vRP] DB driver “ghmattimysql” not initialized yet (39 prepares cached, 5 queries cached).
[vRP] DB driver “ghmattimysql” not initialized yet (39 prepares cached, 5 queries cached).
[vRP] DB driver “ghmattimysql” not initialized yet (39 prepares cached, 5 queries cached).
[vRP] DB driver “ghmattimysql” not initialized yet (39 prepares cached, 5 queries cached).
[vRP] DB driver “ghmattimysql” not initialized yet (39 prepares cached, 5 queries cached).

5 Likes