[HELP] Mysql-Async 2.0 and 3.0.0 errors on linux server

Hello everyone.
I’ve just finished setting up my new linux server, and last thing that is not working i mysql-async.
I have installed version 2.0 instead of 3.0.1 because:

README.md file:

Warning
On Linux servers, users need to stick with the old mysql-async 2.x at least for the moment, due to some issues the linux server has with v8/javascript.
It can be downloaded from https://github.com/brouznouf/fivem-mysql-async/tree/2.0 or the release section. Note that the connection_string is different for 3.0.0 and 2.x.

So I installed 2.0 version and tried to use both string lines:

set mysql_connection_string "mysql://root:randompassword4@188.116.18.177/essentialmode?dateStrings=true"
`set mysql_connection_string "server=188.116.18.177;database=essentialmode;userid=root;password=randompassword;sslmode=none"

mysql-sync 2.0 popped up that error after “Everything is fine” line in console:

[ERROR] [MySQL] An error happens on MySQL for query "SELECT * FROM items {=}": Unable to connect to any of the specified MySQL hosts.

it’s weird, because string is configured correctly (i hope so)

and mysql-sync 3.0.0 popped up that error after “Everything is fine” line in console:

[ERROR] [MySQL] An error happens on MySQL for query "SELECT * FROM items": conne             ct ETIMEDOUT
Error running call reference function for resource es_extended: citizen:/scripti             ng/lua/scheduler.lua:351: server/common.lua:22: attempt to get length of a nil v             alue (local 'result')
stack traceback:
        server/common.lua:22: in upvalue 'ref'
        citizen:/scripting/lua/scheduler.lua:337: in function <citizen:/scriptin             g/lua/scheduler.lua:336>
        [C]: in function 'xpcall'
        citizen:/scripting/lua/scheduler.lua:336: in function <citizen:/scriptin             g/lua/scheduler.lua:335>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:351: in function <citizen:/scriptin             g/lua/scheduler.lua:322>
Unhandled error Error: BUFFER_SHORTAGE
    at n.e [as reserve] (citizen:/scripting/v8/msgpack.js:29:12766)
    at h (citizen:/scripting/v8/msgpack.js:29:15761)
    at n.r [as decode] (citizen:/scripting/v8/msgpack.js:29:13908)
    at n.fetch (citizen:/scripting/v8/msgpack.js:29:6972)
    at n.u [as read] (citizen:/scripting/v8/msgpack.js:29:12076)
    at Object.n [as decode] (citizen:/scripting/v8/msgpack.js:29:7097)
    at unpack (citizen:/scripting/v8/main.js:19:33)
    at citizen:/scripting/v8/main.js:45:11
    at setImmediate (mysql-async.js:5039:9)
    at Object.callback (citizen:/scripting/v8/timer.js:56:6)

Thanks.

This is most likely an issue with your database user. If the database is on the same host as your fivem server, use the localhost IP. If it’s on a different host, make sure that the user you are trying to connect with is allowed to connect with that host.

For more info, read https://dev.mysql.com/doc/refman/5.5/en/adding-users.html

3 Likes

Ok, so I used localhost instead of IP address and it’s not showing any errors, so it seems to be working now. But i’m afraid of using 3.0.1 version instead of 2.0. Is it safe to use the latest version? :smiley:

The new version is way quicker because it’s not confined by the limitations of the mysqlconnector driver in C#.

1 Like

no on linux it is not. you can try if you can get a linux build post version 760.

is a connection error.

Same for Unable to connect to any of the specified MySQL hosts.

Your user is now allowed externally to create an external user do the following on your mysql/mariadb server.

grant all on essentialmode.* to 'yourusername'@'%' identified by 'mysupersecretpassword'

either you put in there % to let any remote connection through or you use the ip of the pc you connect from to the database. also since 3.0.1 both 2.x and 3.0.1 take the same connection strings.

cheers.

1 Like