A pure node.js JavaScript Client implementing the MySql protocol. This is about the node package `mysql`, not `node-mysql` which is much less popular.
Questions tagged [node-mysql]
699 questions
3
votes
2 answers
ER_NO_DEFAULT_FOR_FIELD in MySQL (nodejs rest request)
what does this error mean in mysql?
ER_NO_DEFAULT_FOR_FIELD – “Field doesn’t have a default value”
I've found it listed here?
http://mysqlserverteam.com/improvements-to-strict-mode-in-mysql/
and got:
{
"code": "ER_NO_DEFAULT_FOR_FIELD",
…

dkran
- 284
- 2
- 4
- 16
3
votes
2 answers
MySQL query via Node.js with an unknown number of null parameters
I'm using this MySQL plugin for Node.js. Here's a very simple query:
db.query("SELECT * FROM user WHERE first = ? AND last = ?", [req.query.first, req.query.last], function(error, results) {
console.log(results);
});
Now here's the problem:…

David Jones
- 10,117
- 28
- 91
- 139
3
votes
2 answers
How to update multiple columns using array of datas with a prepared statement?
I have 2 arrays :
columns = ['column1', 'column2'];
data = ['data1', 'data2'];
I'd like to update the table using a prepared query:
conn.query('UPDATE table SET ?? = ? WHERE id = ?', [columns, data, id],
function(err, info){
Excepted sql query…

Bobby Shark
- 1,074
- 2
- 17
- 33
3
votes
3 answers
How to automatically close mysql connection in nodejs
Currently my process is hanging because the mysql pool isn't being closed automatically.
I assumed that when I called connection.release() the connection would get closed if no one else was using it. But it seems that is not the case. My code looks…

lucaswxp
- 2,031
- 5
- 23
- 34
3
votes
1 answer
How can I fetch the warnings after node-mysql queries
How can I fetch the corresponding warning identified after the query execution as in:
connection.query( squery, function(err, rows){
...
// search for OkPacket in 2 dimension array
var warningCounter = okPacket.warningCount;
if (…

Alain
- 1,450
- 3
- 20
- 37
3
votes
1 answer
Using Q with Node-Mysql
I am relatively new to Node but I have had good success with porting over RESTful API that was previously done in PHP. There is quite a bit of database interaction and as a result I have found myself getting into what I believe many people call…

niczak
- 3,897
- 11
- 45
- 65
3
votes
1 answer
SQL Parse Error when using node-mysql
I'm getting parse errors when I try to use node-mysql to invoke a query on a MYSQL database. I'm pretty sure that the query works. It runs without doubt via phpmyadmin.
Message.save = function(message, callback){
db.query("INSERT INTO e_message…

SFL
- 37
- 1
- 4
3
votes
2 answers
stored-procedure return results that I do not want
I use node-mysql to call a stored-procedure, result contains some schema I dont want like fieldCount,affectedRows,how to ignore these?
when I use mysql commend to call the procedure there is no these schemas.
procedure:
DELIMITER \\
CREATE PROCEDURE…

Mil0R3
- 3,876
- 4
- 33
- 61
3
votes
2 answers
MySQL transactions not stopping race conditions from for loop
I'm using node-mysql in my application. I tried implementing SELECT FOR UPDATE but I haven't been able to get it to work properly. The problem I have looks like the code below. The first transaction in the for loop below does not successfully block…

G Kay
- 31
- 1
3
votes
1 answer
generic-pool vs. pooling of node-mysql
I am writing a small Web app with node.js + MySQL and wondering which is a better choice for connection pooling. So far I discovered two options: connection pooling from node-mysql (https://github.com/felixge/node-mysql#pooling-connections) as well…

Yandong Liu
- 335
- 4
- 13
3
votes
1 answer
Express.JS + Node-Mysql and 1 connection per http request
I'm new to Express, and am trying to wrap my head around Express + Node-Mysql.
I want to use a new mysql connection for each http request.
Here is my app.js file:
var express = require( "express" ),
mysql = require( "mysql" ),
routes =…

user1031947
- 6,294
- 16
- 55
- 88
3
votes
3 answers
node-mysql timing
i have a recursive query like this (note: this is just an example):
var user = function(data)
{
this.minions = [];
this.loadMinions = function()
{
_user = this;
database.query('select * from users where…

Joaolvcm
- 1,983
- 3
- 20
- 24
3
votes
1 answer
How to configure node-mysql?
I've found a lot of tutorials explaining how to install "node-mysql" (basically: "npm install mysql" and that's it) and others explaining how to make queries but nothing in-between.
I mean: with no GUI, how do you configure node-mysql (Mysql login,…

Baylock
- 1,246
- 4
- 25
- 49
2
votes
1 answer
node-mysql unable to handle multiple queries?
I am using: node-mysql
arrtickers got around 200 values.
arrtickers closure pass in values into sym.
sym will pass in value to each function (running in async mode, each fn will start running on its own without waiting for the previous fn to…

i need help
- 2,386
- 10
- 54
- 72
2
votes
0 answers
Amazon RDS Proxy Closing Connections
I'm using Amazon RDS Proxy for my main database for my node application. I recently noticed that in my server logs I was receiving a lot of fatal PROTOCOL_CONNECTION_LOST errors with my database instance which would cause my server to reboot (using…

ewein
- 2,695
- 6
- 36
- 54