sidorares / sidorares/node-mysql2

connect ETIMEDOUT

Open
#1,271 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
4.4k
Forks
680
Avg merge
9h 7m
Merged PRs (30d)
59

Description

I'm trying to access DB and run a simple query but no luck I keep getting connect ETIMEDOUT any idea what I'm missing there

I'm using mocha framework , im able t o access the db normally using postgre

it('01. Verify login page is loaded properly',(done)=> {
     console.log('test')
     const pool =  mysql.createPool({
         host: 'something-qa-pg-db.cysxjnygroms.us-east-1.rd.amazonaws.com',
         user: 'owner',
         port: port,
         password: 'pass',
         database: 'name',
         waitForConnections: true,
         connectionLimit: 10,
     });
     const queryResult = browser.call(() => new Promise((resolve, reject) => {
         pool.query('select * from companies order by id desc limit 10', async (error, results, fields)=> {
                 if (error) return reject(error);
                 resolve(results)
             })
     }))
     console.log(queryResult)
 });

also, try the following way but got the same output

    it('01. Verify login page is loaded properly',(done)=> {
        console.log('test')
        const connection =  mysql.createConnection({
            host: 'something-qa-pg-db.cysxjnygroms.us-east-1.rd.amazonaws.com',
            user: 'user',
            port: port,
            password: 'sdsdsd',
            database: 'sdsd',
            waitForConnections: true,
            connectionLimit: 10,
        });
        const queryResult = browser.call(() => new Promise((resolve, reject) => {
            connection.connect(async (err, result) => {
                if (err) return reject(err);
                console.log(result)
               
                connection.query('select * from companies order by id desc limit 10', async (error, results, fields)=> {
                    if (error) return reject(error);
                    resolve(results)
                })
            })
        }))
        console.log(queryResult)
    });

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue only provides Mocha test snippets and does not name a repository file or test to change. Start by checking the connection configuration, endpoint, port, and database compatibility shown in the examples; there is no defined code change or testable completion criterion in the report.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, node.js
Domain
database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.