Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

100
Visualizações
I can't access to mySQL with node js anymore

I have updated my node version, and now I can't access to my DB with my app. I tried many things: -Change rout to 127.0.0.1. -add my port number 3306 -add socketPath: '/Applications/MAMP/tmp/mysql/mysql.sock' -kill node running And probably others, but I always have an error. Actually, I have this one while running this code. Error:

disconnected
error: connect ECONNREFUSED ::1:3306

My code who was working before:

const mysql = require('mysql');

const db = mysql.createConnection({
    host: "localhost",
    user: "root",
    password: "",
    database: "discord"
});
if (db.state === 'disconnected') {
    db.connect(function (err) {
        if (err) { return console.error('error: ' + err.message); }
        console.log('Connected to the MySQL server.');
    });
}
console.log(db.state);
module.exports = db
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

My issue was the version of discord.js because I have updated it as well. I've changed it in my package.json for the one I used before and everything is working well. It will be hard to update all my app to the new version. If you have any recommendation to update it easily without running into multiple issues, I'm here !

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda