LUA error (attempt to get length of a nil value (local 'result'))

Bonjour, j’ai un problème avec plusieurs de mes scripts, il y a toujours ces mêmes erreur :

[ script:mysql-async] [ERROR] [MySQL] An error happens on MySQL for query « SELECT * FROM vehicle_categories {=} »: Unable to connect to any of the specified MySQL hosts. [ script:mysql-async] [ERROR] [MySQL] An error happens on MySQL for query « DELETE FROM phone_messages WHERE (DATEDIFF(CURRENT_DATE,time) > 10) {=} »: Unable to connect to any of the specified MySQL hosts. [ script:mysql-async] [ERROR] [MySQL] An error happens on MySQL for query « SELECT * FROM vehicles {=} »: Unable to connect to any of the specified MySQL hosts. [script:esx_vehiclesh] SCRIPT ERROR: @esx_vehicleshop/server/main.lua:30: attempt to get length of a nil value (local ‹ vehicles ›) [script:esx_vehiclesh] > fn (@mysql-async/lib/init.lua:7) [ script:mysql-async] [ERROR] [MySQL] An error happens on MySQL for query « SELECT * FROM addon_account {=} »: Unable to connect to any of the specified MySQL hosts. [script:esx_addonacco] SCRIPT ERROR: @esx_addonaccount/server/main.lua:9: attempt to get length of a nil value (local ‹ result ›) [script:esx_addonacco] (nil stack trace)[ERROR] [MySQL] An error happens on MySQL for query « SELECT * FROM items {=} »: Unable to connect to any of the specified MySQL hosts. [script:esx_addoninve] SCRIPT ERROR: @esx_addoninventory/server/main.lua:10: attempt to get length of a nil value (local ‹ items ›) [script:esx_addoninve] (nil stack trace)[ERROR] [MySQL] An error happens on MySQL for query « SELECT * FROM jobs {=} »: Unable to connect to any of the specified MySQL hosts. [ script:esx_society] SCRIPT ERROR: @esx_society/server/main.lua:31: attempt to get length of a nil value (local ‹ result ›) [ script:esx_society] (nil stack trace)[ERROR] [MySQL] An error happens on MySQL for query « SELECT * FROM datastore {=} »: Unable to connect to any of the specified MySQL hosts. [script:esx_datastore] SCRIPT ERROR: @esx_datastore/server/main.lua:9: attempt to get length of a nil value (local ‹ result ›) [script:esx_datastore] (nil stack trace)[ERROR] [MySQL] An error happens on MySQL for query « SELECT * FROM items {=} »: Unable to connect to any of the specified MySQL hosts. [ script:mysql-async] [ERROR] [MySQL] An error happens on MySQL for query « SELECT * FROM jobs {=} »: Unable to connect to any of the specified MySQL hosts. [ script:es_extended] SCRIPT ERROR: @es_extended/server/common.lua:35: attempt to get length of a nil value (local ‹ result ›) [ script:es_extended] (nil stack trace)-- [server notice: hostname_rework]

Voci aussi une partie du script main.lua de mon adonaccount (pour exemple) :

local AccountsIndex, Accounts, SharedAccounts = {}, {}, {} ESX = nil

TriggerEvent(‹ esx:getSharedObject ›, function(obj) ESX = obj end)

MySQL.ready(function() local result = MySQL.Sync.fetchAll(‹ SELECT * FROM addon_account ›)

for i=1, #result, 1 do
	local name   = result[i].name
	local label  = result[i].label
	local shared = result[i].shared

	local result2 = MySQL.Sync.fetchAll('SELECT * FROM addon_account_data WHERE account_name = @account_name', {
		['@account_name'] = name
	})

	if shared == 0 then
		table.insert(AccountsIndex, name)
		Accounts[name] = {}

		for j=1, #result2, 1 do
			local addonAccount = CreateAddonAccount(name, result2[j].owner, result2[j].money)
			table.insert(Accounts[name], addonAccount)
		end
	else
		local money = nil

		if result2 == 0 then
			MySQL.Sync.execute('INSERT INTO addon_account_data (account_name, money, owner) VALUES (@account_name, @money, NULL)', {
				['@account_name'] = name,
				['@money']        = 0
			})

			money = 0
		else
			money = result2[1].money
		end

		local addonAccount   = CreateAddonAccount(name, nil, money)
		SharedAccounts[name] = addonAccount
	end
end

end)

Merci d’avance de votre réponse, bonne journée.

comme ecrit. la ressource n’arrive pas a se connecter a la bdd.