sidorares / sidorares/node-mysql2

SET NAME uft8mb4 loop when doing querys

Open
#757 17 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 followed the first query example and it's not working and not giving any errors. Maybe it's because my database is on a different port than default.

My code

const mysql = require('mysql2');

const connection = mysql.createConnection(
    {
    host: 'database host',
    port: '6033',
    user:'clippie',
    password:'clippe password',
    database: 'clippie',
    }
);

connection.query(
    'SELECT * FROM questions',
    function(err, results){
        if(err) throw err;
        console.log('getting questions');
        console.log(results);
});

I tested this with mysql package and worked like it should but for what i'm maknig i need prepared statements what mysql not supports.

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

Start by reproducing the provided mysql2 createConnection and SELECT query using port 6033, then compare its behavior with the mysql package. Check whether the query callback receives results or an error, and document the cause and a reproducible resolution for the connection loop.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.