rodrigogs / mysql-events

A node package that watches a MySQL database and runs callbacks on matched events.
BSD 3-Clause "New" or "Revised" License
136 stars 52 forks source link

Can't connect to any database. #6

Closed Uniixx closed 5 years ago

Uniixx commented 5 years ago

I tried to use my credentials and even on the runkit It gives the same error:

const connection = mysql.createConnection({
    host:     "secret.rds.amazonaws.com",
    user:     "secret",
    password: "secret",
    port: 3306
  })
{ Error: connect ECONNREFUSED 127.0.0.1:3306
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)
    --------------------
    at Protocol._enqueue (C:\Users\Nathan\Desktop\Rocket-Elevators-AI\node_modules\@rodrigogs\mysql-events\node_modules\mysql\lib\protocol\Protocol.js:144:48)
    at Protocol.handshake (C:\Users\Nathan\Desktop\Rocket-Elevators-AI\node_modules\@rodrigogs\mysql-events\node_modules\mysql\lib\protocol\Protocol.js:51:23)
    at Connection.connect (C:\Users\Nathan\Desktop\Rocket-Elevators-AI\node_modules\@rodrigogs\mysql-events\node_modules\mysql\lib\Connection.js:118:18)
    at Promise (C:\Users\Nathan\Desktop\Rocket-Elevators-AI\node_modules\@rodrigogs\mysql-events\lib\connectionHandler.js:5:75)
    at new Promise (<anonymous>)
    at connect (C:\Users\Nathan\Desktop\Rocket-Elevators-AI\node_modules\@rodrigogs\mysql-events\lib\connectionHandler.js:5:31)
    at connectionHandler (C:\Users\Nathan\Desktop\Rocket-Elevators-AI\node_modules\@rodrigogs\mysql-events\lib\connectionHandler.js:30:11)
    at MySQLEvents.start (C:\Users\Nathan\Desktop\Rocket-Elevators-AI\node_modules\@rodrigogs\mysql-events\lib\MySQLEvents.js:88:29)
    at program (C:\Users\Nathan\Desktop\Rocket-Elevators-AI\src\events\message.js:35:18)
    at Object.<anonymous> (C:\Users\Nathan\Desktop\Rocket-Elevators-AI\src\events\message.js:50:1)
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 3306,
  fatal: true }

For some reason It keeps using localhost.

rodrigogs commented 5 years ago

I'm going to check it as soon as I can