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
0
votes
1 answer
Too many connection.release
I'm using node-mysql with pool connection to handle database stuff. Everything is great, but the way connection is released. It seems that connection.release() need calling at anytime an event is going to be ended. This is very inconvenient and also…

user3925697
- 609
- 2
- 8
- 17
0
votes
1 answer
How can I assign result.insertId to id from function that i pass in query() function?
When i try to log id variable i get 'undefined'. How can I assign result.insertId to id from function that i pass in query() function?
var id;
connection.query('INSERT INTO posts SET ?', {title: 'test'}, function(err, result) {
if (err) throw…

veinhorn
- 2,363
- 6
- 21
- 33
0
votes
2 answers
MySQL Nesting Relations
I use backbone and need to nest Answers in Questions and Questions in Categories.
My problem is the data I get from MySQL.
I would like to have an array I can easily use with backbone, starting at the top (Category) and nest down to the bottom…

Silom
- 736
- 1
- 7
- 20
0
votes
1 answer
node-webkit MySQL connection Error - ER_HANDSHAKE_ERROR: Bad handshake
I am using Node-Webkit for creating desktop application using NodeJS.
In this i need to get data from MySQL database. For this am using node-mysql module and the following code is used to connect MySQL server using node-mysql.
var mysql_con =…

Hackableweb
- 372
- 1
- 5
- 17
0
votes
0 answers
MySQL for node.js
I am trying to create a database for my node.js server using MySQL. I am aware of the node-mysql module. I found an example here but am not able to make it work. I have MySQL Workbench installed on my computer, will that do? Or do I have to install…

raul
- 1,209
- 7
- 20
- 36
0
votes
1 answer
Can't connect to MySQL DB using node-mysql
I'm learning Node.js, and I've decided to poke at node-mysql. I'm trying to insert some text, and its not working-when I query the relevant table, nothing is there. When I set a breakpoint and debug, the connection state says "disconnected." What am…

Amanda_Panda
- 1,156
- 4
- 26
- 68
0
votes
2 answers
Express JS how to include node-mysql object from a different file
I want to include my mysql connection from the same file(in case I have to change sql password or anything I don't want to change in a many files).
Here is my mysql.js file:
module.exports = require('mysql').createConnection(
{
host :…

Zsoca
- 358
- 1
- 5
- 16
0
votes
0 answers
jQuery dataTables - Requested unknown parameter 'field1' for row 0
I fell kind of bad after checking all other SO question on this matter and not being able to solve it, but here we go.
When I populate my datatable with a simple $.ajax call it's fine, now I want to do it using sAjaxSource in the oTable definition…

Daniel Sh.
- 2,078
- 5
- 42
- 67
0
votes
0 answers
In node can we use multiple mysql statements in one connection query?
In node-socketchat system, i am using mysql module.
I wants to take data after checking through 4-5 tables, but cannot make a join statement.
suppose i need to take a friends collection and their details.
Now i am following below method.
var friends…

jpk
- 189
- 4
- 13
0
votes
1 answer
how to use dayofmonth function using node mysql
I am trying to use a sql query which looks like:
'SELECT day(created), hour(created), minute(created), count(*) FROM `delivery` WHERE `type_id`=1 AND `created`>=`2014-05-19 00:00:00` AND `created`<=`2014-05-19 23:59:59` GROUP BY …

brownmamba
- 755
- 1
- 8
- 16
0
votes
1 answer
node js returning mysql data to variables
I'm trying to use node js and mysql, along with rendering data from my database into a view.
The issue is, how do I render multiple pieces of data within 1 view (Using jade template).
router.get('/about', function(req, res) {
var animalsData =…

Tyler Evans
- 567
- 1
- 8
- 25
0
votes
2 answers
node.js mysql client undefined
I'm trying to create a mysql database to node.js server. I've installed mysql module through command prompt:
npm install mysql
Then I execute the following code:
var Client = require('mysql').Client;
console.log(Client);
Console display undefined.…

Rejaul
- 831
- 1
- 12
- 35
0
votes
1 answer
Any better solution about asynchronous query form main table and sub table?
I have two tables, tb_article and tb_attach_url, like this
==============tb_article=================
id title content
1 "echo" "test"
2 "foo" "bar"
==============tb_attach_url==============
id article_id …

laifjei
- 606
- 2
- 7
- 16
0
votes
1 answer
NodeJS executing code in wrong order. Why?
The code I've written is executing in blocks, rather than sequentially.
As an example:
Task 1 result Task 1 result Task 1 result
Task 2 result Task 2 result Task 2 result
Task 3 result Task 3 result Task 3 result
I'd like the order of execution…

Joel Murphy
- 2,472
- 3
- 29
- 47
0
votes
1 answer
javascript array clarification
I'm new to Javascript and have this issue:
console.log(results1[1]);
prints: [ { product_identification_category_id: 1, title: 'Title1' } ]
console.log(results1[1].product_identification_category_id);
prints undefined. I was expecting this to…

Jason
- 1,787
- 4
- 29
- 46