Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

102
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda