Constant MySQL Errors with all MySQL Dependant Plugins

I’ve been trying for the last 4 or so hours to attempt to fix the issue however have no luck. It is only with plugins requiring MySQL, I’ve read other support topics and haven’t been able to find an answer. I’ve followed all installations and have been moving files around trying different things, I’ve installed and reinstalled changed the database and edited all connection strings to lead to the database yet I’m getting the same error for everything. It only appears however after a player joins into the server, at first it was on startup.

This is the initial error - It is followed with others for each plugin all reading the same thing.

[ERROR] [MySQL] [esx_datastore] An error happens on MySQL for query "[object Object]": connect ETIMEDOUT
[MySQL] [Slow Query Warning] [esx_addoninventory] [80596ms] SELECT * FROM items
[ERROR] [MySQL] [esx_addoninventory] An error happens on MySQL for query "[object Object]": Handshake inactivity timeout
[MySQL] [Slow Query Warning] [esx_shops] [80596ms] SELECT * FROM shops LEFT JOIN items ON items.name = shops.item
[ERROR] [MySQL] [esx_shops] An error happens on MySQL for query "[object Object]": Handshake inactivity timeout
[MySQL] [Slow Query Warning] [es_extended] [80595ms] SELECT * FROM items
[ERROR] [MySQL] [es_extended] An error happens on MySQL for query "[object Object]": Handshake inactivity timeout
Error calling system tick function in resource mysql-async: AssertionError [ERR_ASSERTION]: unexpected PromiseRejectEvent
stack:

Followed by one of these for all required plugins

at Protocol._enqueue (mysql-async.js:6167:48)
at Protocol.handshake (mysql-async.js:6074:23)
at PoolConnection.connect (mysql-async.js:711:18)
at Pool.getConnection (mysql-async.js:4753:16)
at Pool.query (mysql-async.js:4907:8)
at Promise (mysql-async.js:5146:12)
at new Promise (<anonymous>)
at execute (mysql-async.js:5143:26)
at Object.global.exports [as callback] (mysql-async.js:5169:5)
at citizen:/scripting/v8/main.js:96:41
Error: (node:19) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
Error: (node:19) UnhandledPromiseRejectionWarning: Error: Handshake inactivity timeout
at Handshake.<anonymous> (mysql-async.js:6183:17)
at emitNone (events.js:106:13)
at Handshake.emit (events.js:208:7)
at Handshake._onTimeout (mysql-async.js:316:8)
at Timer._onTimeout (mysql-async.js:13221:23)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)

Any and all help is appreciated, everything was working seemingly perfect in previous tests.

Error: MySQL shutdown unexpectedly.
1:26:33 PM [mysql] This may be due to a blocked port, missing dependencies,
1:26:34 PM [mysql] improper privileges, a crash, or a shutdown by another method.
1:26:34 PM [mysql] Press the Logs button to view error logs and check
1:26:34 PM [mysql] the Windows Event Viewer for more clues
1:26:34 PM [mysql] If you need more help, copy and post this
1:26:34 PM [mysql] entire log window on the forums

so i am having this issue trying to start up mysql on xampp can someone help me to get this fixed.

Did you ever find a fix for this i have the same issue witrh xampp

This is not an ESX or plugin issue, it is a MySQL connection problem.

The key parts of the error are:

  • connect ETIMEDOUT → the server cannot reach the database
  • Handshake inactivity timeout → the connection attempt is made, but it becomes unresponsive

Since this occurs across all scripts (esx_datastore, shops, etc), it confirms the issue is global, not tied to a specific resource.

What is happening

When a player joins, the server begins executing multiple database queries (items, inventories, etc).
At that point, the connection to the database either fails or does not respond in time, resulting in timeouts.

Recommendation

If you are still using mysql-async, it is recommended to switch to oxmysql.

In practice, oxmysql provides better stability and performance under load, and issues of this nature are generally easier to diagnose.

I use oxmysql and everytime i launch my xampp and hit run mysql it says a port is broken im trying to figure it out but it never works everything i do it just doesn’t work. and if i restart the oxmysql resource it allows me to load in but i get stuck on awaiting scripts.

It’s probably a silly idea, but try using HeidiSQL.

I have tried that it still doesn’t work for some reason

Please send me a screenshot of your error, because I had a similar problem on my localhost a while ago when I was using XAMPP—something like blocked ports.

Are you on localhost or a VPS?