Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

296
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!