[Release] MySQL Async Library - 3.3.2

Will try to do some benchmark and load testing, but no time over the next days will be done next weeks, anyway i know there is something that need to be cleared in the lib and that was forgottent, maybe it will resolve this.

Awesome. Thanks for taking the time to look into this :smiley:

Iā€™m not having any luck with 2.0 & FXServer. I have the convar set :

set mysql_connection_string "server=<ip>;database=<db>;userid=<user>;password=<pass>"

ā€˜@mysql-async/lib/MySQL.luaā€™ is in my resourceā€™s server_scripts

isMySQLReady = false
AddEventHandler('onMySQLReady', function ()
	print('MySQL is ready.')
	isMySQLReady = true
	MySQL.Async.fetchScalar("SELECT COUNT(1) FROM users", {}, function(countPlayer)
		print(countPlayer)
	end)
end)

Iā€™m getting :

An error happens when opening MySQL connection libmono-btls-shared
[0ms] An error happens when executing SELECT COUNT(1) FROM users : Object reference not set to an instance of an object
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object

I canā€™t get it to connect. The same db connection works fine with 0.2.2 and the legacy Citizen Server. Is there anything else I need?

@kyai

Iā€™m not 100% sure, but I think the convar needs a port. You could try looking at the 0.2.2 version and check if there is a port in the convar. If there is, then itā€™s probably the reason why.

Example:

set mysql_connection_string ā€œserver=ip;**port=3306;**database=db;userid=user;password=passā€

@TheLukasGran

Comment out the latest code that you edited. Keep commenting out the latest code until you can start the server without errors. You need to understand that nobody can help you without seeing the code.

1 Like

Anyone have any issues with

Error loading script server.lua in resource ply_vipslot: server.lua:1: attempt to call a nil value (global 'server_script')
stack traceback:
        server.lua:1: in main chunk
Failed to load script server.lua.

Iā€™m using

server_script '@mysql-async/lib/MySQL.lua'

Trying to call for async in another resource.
Am I doing something wrong? lol

You need to use that in the resource manifest, not a script.

Guys i put the

server_script ā€˜@mysql-async/lib/MySQL.luaā€™

every single __resource.lua requires mysql but i still get errors :

ok so has anyone found a way to make this work and if u have can you please make a video

1 Like

Guys, where the convar is prescribed? I do not understand. Never had with these things

Having double SQL triggers. Canā€™t determine why.

I am getting errors for every mod that is calling the mysql-async lib and I canā€™t seem to figure out why. I am running LaLife on windows server 2008 r2. If you need any more info just let me know. Any help would be appreciated. Thanks.

This line

set mysql_connection_string "server=127.0.0.01;database=gta5_gamemode_essential;userid=root;password=1202

if youā€™re using FX server will go into your server.cfg file. You just need to replace the information in there with your current information.

1 Like

This still being figured out? still getting this.

Error loading script server.lua in resource ply_garages: server.lua:3: attempt to call a nil value (global 'server_script')
 stack traceback:
 	server.lua:3: in main chunk
 Failed to load script server.lua.

I have done the

server_script '@mysql-async/lib/MySQL.lua'

Ok. well i got the previous errors fixed I think. I put .lua at the end of every call function for mysql-async and the errors went away but now I have a new error.

I got all the error taken care of finally. There was some dll files being blocked.

hello i get this error : unable to find the specified file . this only happen after the new update for async
asmebly I18N http://imgur.com/a/Yma0h

the file neede i try get essentialmode work but can see you have not puttede in too fx will you not plz do that so i can use old essentialmode plz ty
the mysql-async need this :confused: plz

are there any video tutorials on how to install this?
getting slightly confusing with the installation.

1 Like

This is my older scriptā€¦

function isBlacklist(identifier)
	executed_query = MySQL:executeQuery("SELECT * FROM blacklist WHERE identifier = '@username' AND blacklist = 1",{['@username'] = identifier})
    result = MySQL:getResults(executed_query, {'blacklist'}, "identifier")
	if (result[1]) ~= nil then
		return true
	end
	return false
end

How to get this script work with MySQL Async Library???

MySQL:executeQuery = MySQL.Async.fetchAll / MySQL.Async.execute
MySQL:getResults = ???

Thanksā€¦

MySQL.Async.fetchScalar("SELECT * FROM blacklist WHERE identifier = @username and blacklist  = 1", {['@username'] = identifier}, function(result)
     if (result[1] ~= nil) then
          return true
     end
     return false
end)

somethin like that I think?

1 Like

Unluckyā€¦
Not workingā€¦

Still thanksā€¦