brouznouf / fivem-mysql-async

MySql Async Library for FiveM
MIT License
111 stars 106 forks source link

MySQL.ready issue only on linux (debian 9/mariadb) #25

Closed WebMatPro closed 7 years ago

WebMatPro commented 7 years ago

Hi,

thanks for your great ressource.

I have a trouble issue on Linux, débian 9 with mariadb.

On windows for my mysql test, i will load a server.lua with

MySQL.ready(function ()
    local countPlayer = MySQL.Sync.fetchScalar("SELECT COUNT(1) FROM users") -- get count from table in mysql   
        local countPlayerText = 'YAHOU !! ligne en mysql = ' .. countPlayer -- friendly text 
    print(countPlayerText) -- print in console 
end)

so will work perfectly at the load server side, but on linux, nothing.

I m sure about my mysql connection because i tried to run my request directly and is fine.

Best Regards.

WebMatPro commented 7 years ago

On console at the start server

Loaded MySqlConnector, Version=0.26.0.0, Culture=neutral, PublicKeyToken=null into ScriptDomain_1649366546
Loaded System.Threading.Tasks.Extensions, Version=4.1.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 into ScriptDomain_16
49366546
Loaded System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 into ScriptDomain_1649366546
YAHOU !! ligne en mysql = 1

on linux

Loaded MySqlConnector, Version=0.26.0.0, Culture=neutral, PublicKeyToken=null into ScriptDomain_2097110674

stop at this line, no more

bozoweed commented 7 years ago

hi can you maybe try this ? MySQL.ready(function () print("started mysql and ready") local countPlayer = MySQL.Sync.fetchScalar("SELECT COUNT(1) FROM users") -- get count from table in mysql
if countPlayer ~= nill then print("get return") if countPlayer > 0 then local countPlayerText = 'YAHOU !! ligne en mysql = ' .. countPlayer -- friendly text print(countPlayerText) -- print in console else print("nothing found but get return") end else print("no return from querry") end end) i can speak in french if you need more help because i seen in you message for count you have used french

WebMatPro commented 7 years ago

ah oui cool, vous êtes français ?

j'essaye votre modif et je reviens vers vous.

Pour info, j'avais écris un article sur l'installation de votre ressource : https://gta5.cool/comment-installer-fivem-mysql-async/

bozoweed commented 7 years ago

oui je le suis par contre je ne suis pas le créateur de la ressource, je suis juste le devellopeur de vision rp ^^

WebMatPro commented 7 years ago

ah mince je suis bête ^^

non j'ai absolument tout testé avec le mysql.ready, sur linux il ne s’exécute pas comme prévu.

Je suis évidemment bien certain que mon cache soit vide, que mon .lua se load et que ma requête mysql fonctionne correctement (exemple je place en direct et je restart ma ressource)

Le problème évidemment c'est que les ressources comme ES, ESX etc ne fonctionnent pas également, sur windows je n'ai absolument aucun problème. J'ai essayé de réinstallé plusieurs fois le serveur, rien n'y fait et je suis bien en full root

Il y a des apt indispensable pour FiveM et mysql-sync sous Linux / Debian 9 ?

merci pour ton aide en tous cas

joelwurtz commented 7 years ago

Try to start mysql async as the last resource

WebMatPro commented 7 years ago

exactly same ...

do you know why i have a some diffenrece betwen windows and linux ?

i will reset my debian 9, what i need exactly ?

Mariadb or Mysql ? need anoher package ?

thanks you

joelwurtz commented 7 years ago

Don't know at all, the errors comes from fxs not mysql or other thing related

WebMatPro commented 7 years ago

i think too about data fivem :/ but i m only one with this problem on linux ? Oo

joelwurtz commented 7 years ago

No other person too with startup problem, read the forum post on fivem

WebMatPro commented 7 years ago

Hi,

i just upload your resource and now its right :)

great developper.

if you want to help french people to install your plugin, you can add the link of my video in your wiki

https://www.youtube.com/watch?v=vDvbyqyzyQw