Questions tagged [mysql2]
The Mysql2 gem is meant to serve the extremely common use-case of connecting, querying and iterating on results.
mysql2
941
questions
0
votes
1
answer
22
views
Mysql2 Error when lost connection, it don't reconnect
I develop in nodejs (expressjs) with mysql2. When I close or restart mysql server my application thorws error and nodemon crashes and don't reconnect to mysql server. I want to reconnect every 5 ...
0
votes
0
answers
15
views
Next.js 14 - require crypto error with mysql2 in turbo mode
For the past few days, I've been trying to get turbo mode working in Next.js 14 with MySQL2. Despite using every available resource to solve the issue, I'm still stuck with the error. My large project ...
0
votes
0
answers
33
views
how do i fix incorrect mysql library version in ruby on rails?
im trying to make an application that connect to a mysql databse, but whatever i do, i kept making zero progress because i cant get past this line
Incorrect MySQL client library version! This gem was ...
-1
votes
0
answers
29
views
Why my code is not working with execute method and only works with query method?
I'm trying to insert data from postman, using the column I get from req.body.
I don't see what am doing wrong, but for some reason my code only works with conn.query and not conn.execute. Why is that?
...
0
votes
0
answers
21
views
Use custom MySQL2 connection pool into Knex - getting stucked
I am trying to pass a mysql2 connection pool to the Knex client by following the official documentation. However, the query execution seems to get stuck. Even though the insert query successfully ...
0
votes
0
answers
20
views
Mysql rows transposing in Node.js with mysql2 [duplicate]
I am running an SQL script in Node.js using mysql2 npm-package. This script has multiple SQL statements that have to ultimately transpose a table's rows into columns. The SQL script runs correctly ...
0
votes
0
answers
21
views
Error: Can't add new command when connection is in closed state QueryFailedError (nestjs + mysql2 + typeorm)
I have an issue after some hours of work and I need restart the server.
ERROR \[TypeOrmLogger\] Error: Can't add new command when connection is in closed state QueryFailedError: Can't add new command ...
0
votes
1
answer
43
views
Installation of mysql2 0.5.6 ruby gem in Windows 10 fails
an attempt to install 'mysql2' gem in Windows 10 fails. I did some search on internet and tried multiple suggestions without success.
As suggested in mysql2 gem documentation the MySQL Connector/C ...
0
votes
1
answer
70
views
TypeError: pool.promise is not a function
I am using mysql2 library for connecting to database.
const pool = mysql.createPool({
connectionLimit: process.env.DB_CONNECTION_LIMIT,
host: process.env.DB_HOST,
user: process.env.DB_USER,
...
0
votes
0
answers
82
views
Too Many Connections MySQL2 + NextJS
I'm currently experiencing some issues with my API. It works well for the first few requests, but after a while I end up getting a Too Many Connections Error causing my entire Database to crash as ...
0
votes
0
answers
31
views
How to mask values in "POST"/"PUT" request bodies and "Insert"/"Update" SQL statements in Sentry?
The request body of POST/PUT requests is being logged in Sentry, displaying the values. Instead, the log should show the keys and mask the values by replacing them with ** or ??.
The queries are ...
2
votes
1
answer
145
views
Problem with mysql2 installation on Sonoma MacOS
I'm having trouble with my mysql2 installation on Sonoma 14.3.1.
I have already installed MySQL via brew, as well as openssl (OpenSSL 3.3.0 9 Apr 2024) and zstd (Zstandard CLI 64-bit v1.5.6) libraries....
1
vote
1
answer
125
views
How to make execute/query in mysql2 return array instead of mysql.QueryResult
I've written this test query:
const [results] = await connection.execute(
`
SELECT * FROM providers WHERE id IN (${ids.join(',')})
`,
);
However it returns mysql....
0
votes
1
answer
60
views
ActiveRecord::StatementInvalid: Mysql2::Error: This connection is in use by: #<Fiber:0x0000000XXXX (resumed)>
I see this error randomly when I run the rails test.
After I upgraded some of my gems.
I have been activating and deactivating them one by one. The new ones prometheus_client and amazing_print don't ...
0
votes
0
answers
170
views
Sequelize vs MySQL-2: Seems like MySQL2 Raw Query Executions are faster
I am using Sequelize v6.23.0 in my Node.js (v16.x) project.
The query executions are taking very long. So, I did a quick comparison between Sequelize and MySQL2 library. The execution time difference ...