Recently, I was adding resources to my server, and when i was trying to get all of the Essentials and extended working, I came across errors with MySQL, which is as follows:
[ERROR] connect ECONNREFUSED 127.0.0.1:3306
[ERROR] [MySQL] [es_extended] An error happens on MySQL for query “SELECT * FROM jobs”: connect ECONNREFUSED 127.0.0.1:3306
[ERROR] [MySQL] [es_extended] An error happens on MySQL for query “SELECT * FROM items”: connect ECONNREFUSED 127.0.0.1:3306
Error: (node:19160) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:3306
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)
--------------------
at Protocol._enqueue (mysql-async.js:6149:48)
at Protocol.handshake (mysql-async.js:6056:23)
at PoolConnection.connect (mysql-async.js:711:18)
at Pool.getConnection (mysql-async.js:4759:16)
at Pool.query (mysql-async.js:4913:8)
at Promise (mysql-async.js:5220:10)
at new Promise ()
at MySQL.execute (mysql-async.js:5216:26)
at Object.global.exports [as callback] (mysql-async.js:5109:9)
at citizen:/scripting/v8/main.js:96:41
Error: (node:19160) 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: 1)
Error: (node:19160) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Error: (node:19160) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:3306
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)
--------------------
at Protocol._enqueue (mysql-async.js:6149:48)
at Protocol.handshake (mysql-async.js:6056:23)
at PoolConnection.connect (mysql-async.js:711:18)
at Pool.getConnection (mysql-async.js:4759:16)
at Pool.query (mysql-async.js:4913:8)
at Promise (mysql-async.js:5220:10)
at new Promise ()
at MySQL.execute (mysql-async.js:5216:26)
at Object.global.exports [as callback] (mysql-async.js:5109:9)
at citizen:/scripting/v8/main.js:96:41
Error: (node:19160) 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)
I was trying to get it to connect the database to my server, and I figured that since I had set it up, and since I was able to get this far by following tutorials, that it would be worth however long this takes to fix, but my server now won’t start up without this.