0
respostas

Erro ao executar comando

Jordan@rifa:~/rifa$ CLIENTE_MYSQL_USUARIO=root CLIENTE_MYSQL_SENHA=O14zdLP7 CLIENTE_MYSQL_HOST=35.239.145 CLIENTE_PORTA_API=80 node api/banco-de-dados/criarTabelas.js:

ConnectionRefusedError [SequelizeConnectionRefusedError]: connect ECONNREFUSED 127.0.0.1:3306
    at ConnectionManager.connect (/home/Jordan/rifa/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:116:17)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async ConnectionManager._connect (/home/Jordan/rifa/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:318:24)
    at async /home/Jordan/rifa/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:250:32
    at async ConnectionManager.getConnection (/home/Jordan/rifa/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:280:7)
    at async /home/Jordan/rifa/node_modules/sequelize/lib/sequelize.js:613:26
    at async MySQLQueryInterface.createTable (/home/Jordan/rifa/node_modules/sequelize/lib/dialects/abstract/query-interface.js:225:12)
    at async Function.sync (/home/Jordan/rifa/node_modules/sequelize/lib/model.js:1300:5) {
  parent: Error: connect ECONNREFUSED 127.0.0.1:3306
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16) {
    errno: -111,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '127.0.0.1',
    port: 3306,
    fatal: true
  },
  original: Error: connect ECONNREFUSED 127.0.0.1:3306
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16) {
    errno: -111,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '127.0.0.1',
    port: 3306,
    fatal: true
  }
}

default.json:
{
    "mysql": {
        "banco-de-dados": "clientes",
        "usuario": "root",
        "senha": "",
        "host": "127.0.0.1"
    },
    "api": {
        "porta": 3306
    }
}
Também executei com a porta 3000