JavaScript Node.js application crashes with mysql node application crashes,heroku app crashed node

I am using node.js for an application, I'm also using mysql to allow users to connect on the app.

I was using the application on local, and it was working pretty well, no crash, nothing bad.

Today I tried to put the js server on my dedicate server and the client on my web server.

Now that it is uploaded, I try to launch the server, but it crashes after a few seconds with these tracebacks :

events.js:48

    throw arguments[1]; // Unhandled 'error' event

Error: Connection lost: The server closed the connection.
    at Protocol.end (/root/node_modules/mysql/lib/protocol/Protocol.js:73:13)
    at Socket.onend (stream.js:80:10)
    at Socket.emit (events.js:88:20)
    at TCP.onread (net.js:388:51)

The connection code is simple :

var mysql = require('mysql');
var connection = mysql.createConnection({
    host : 'hostname',
    user : 'username',
    password : 'password',
    database : 'database',
});
connection.connect();

I tried to add a column into my db just after the connection and it works fine, my database which is on a different server than the js server accepts the connection and adds the column.

I don't know why I don't have these errors while I'm working on local...

Answer:1

I have the following controller action: var fileName = "monthly_report.pdf" var document = new Document(); //DO SOME STUFF WITH THE DOCUMENT MemoryStream stream = new MemoryStream(); ...

I have the following controller action: var fileName = "monthly_report.pdf" var document = new Document(); //DO SOME STUFF WITH THE DOCUMENT MemoryStream stream = new MemoryStream(); ...

I am now using Semantic UI without including Bootstrap as there are some conflicts among them. But I quite like the Carousel function of bootstrap. Can I optionally include it in my project? Thanks a ...

I am now using Semantic UI without including Bootstrap as there are some conflicts among them. But I quite like the Carousel function of bootstrap. Can I optionally include it in my project? Thanks a ...

  1. text only carousel bootstrap 4
  2. text only carousel bootstrap
  3. text only carousel bootstrap 3
  4. bootstrap only carousel

I have this: personname: function(value, element) { return this.optional(element) || /^[a-zA-Z\s]+$/.test(value); } But when the name is Pëter Müller or something like that it is invalid, how ...

I have this: personname: function(value, element) { return this.optional(element) || /^[a-zA-Z\s]+$/.test(value); } But when the name is Pëter Müller or something like that it is invalid, how ...

  1. make input only accept numbers
  2. make input only readable
  3. make input readonly
  4. make input numbers only
  5. make input field only accept numbers
  6. make input accept only numbers html
  7. make input numeric only
  8. html make input readonly
  9. make input number only html
  10. css make input readonly
  11. javascript make input readonly
  12. make input type read only
  13. make input field number only
  14. make input field read only
  15. how to make input only an integer in c++
  16. make input field read only css
  17. how to make input only accept numbers python
  18. make input tag read only
  19. make input box read only
  20. make input text readonly

I've been given the task of updating some Javascript for IE10. I've searched endlessly for a solution, but I just can't seem to find one. The piece of code I'm stuck at is: var svgns = "http://www.w3....

I've been given the task of updating some Javascript for IE10. I've searched endlessly for a solution, but I just can't seem to find one. The piece of code I'm stuck at is: var svgns = "http://www.w3....

  1. update with work
  2. update work in texas profile
  3. update work on facebook
  4. update work in progress
  5. update work permit with new passport
  6. update on work construction of signet by omkar
  7. update on work email