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

482
Views
I can't connect my nodejs server to my mariadb raspberry pi

I'm trying to make a forum with a mariadb database on my raspberry pi (the nodejs server is on my computer and the database is on my raspberry) I can't connect to my raspberry pi with a user...

i get this error :

SqlError: (conn=-1, no: 45028, SQLState: HY000) retrieve connection from pool timeout after 10015ms
    at Object.module.exports.createError (C:\Users\Josselin Arnaud\Desktop\forum\node_modules\mariadb\lib\misc\errors.js:56:10)
    at Pool._requestTimeoutHandler (C:\Users\Josselin Arnaud\Desktop\forum\node_modules\mariadb\lib\pool.js:332:18)
    at listOnTimeout (node:internal/timers:557:17)
    at processTimers (node:internal/timers:500:7) {
  text: 'retrieve connection from pool timeout after 10015ms',
  sql: null,
  fatal: false,
  errno: 45028,
  sqlState: 'HY000',
  code: 'ER_GET_CONNECTION_TIMEOUT'
}

and here is my code :

const pool = mariadb.createPool({
     host: '192.168.0.45', 
     user:'root', 
     password: '*hello*',
     connectionLimit: 5
});
pool.getConnection()
    .then(conn => {
    
      conn.query("SELECT * FROM forum.utilisateur")
        .then((rows) => {
          console.log(rows); //[ {val: 1}, meta: ... ]
          //Table must have been created before 
          // " CREATE TABLE myTable (id int, val varchar(255)) "
          return conn.query("INSERT INTO forum.utilisateur value (?, ?)", [1, "mariadb", "mariadb", "mariadb", "mariadb"]);
        })
        .then((res) => {
          console.log(res); // { affectedRows: 1, insertId: 1, warningStatus: 0 }
          conn.end();
        })
        .catch(err => {
          //handle error
          console.log(err); 
          conn.end();
        })
        
    }).catch(err => {
      //not connected
      console.log(err);
});

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!