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

293
Vistas
How to connect to mysql server with electron?

I'm trying to connect my electron app to a database, but I keep getting the same error

ETIMEOUT
or that the user don't have access

But if I try with my local database works fine, any ideas of why is this happening?

var mysql = require('mysql');

    // Add the credentials to access your database
    var connection = mysql.createConnection({
        host     : 'xxx.xxx.xxx',
        user     : 'xxxxx',
        password : 'xxxxxxx', 
        database : 'xxxxx',
        pool: { 
            max: 1000,
            min: 0,
            idleTimeoutMillis: 30000000
          },
          options: {
            "enableArithAbort": false,
            "encrypt": false
        }, 
          debug: true
    });

    // connect to mysql
    connection.connect(function(err) { 
        if(err){
            console.log(err.code);
            console.log(err.fatal);
        } else {
            console.log("OK");
        }
    });
about 4 years ago · Juan Pablo Isaza
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