NodeJS + MySQL Database Connection Tutorial




Learn how to do NodeJS + ExpressJS + MySQL database connection using XAMPP as MySQL database and querying data from database.

Original source


20 responses to “NodeJS + MySQL Database Connection Tutorial”

  1. i have question about connectionlimt 50 .is it not disadvantage when thousand user want login same time then it take much time to login? and if we not use limit can we use release connection ?it will be helpful if you release after query run every coneection. please correct me i am little bit confus.

  2. Hello ! Nice tutorial.

    Im new using NodeJS and I have this couple of doubts:

    Once I make the connection with the db ( connection.connect(); ) In my conf.js file, this connection can be used in other files using " module.exports = connection; " ?

    That being said, I have another question:

    I'm used to work with CodeIgniter as an API, where the connection to the MySQL lives only during each request. In this case, taking in count that NodeJS should "be on" the whole time, is it bad to have a non stop living connection ? How does this work ?

    Thanks !

  3. Hi thanks Mehul for your excellent vdo tutorials.. I using MySql database with nodejs …please help me to develop the code to display the MySql database's table contents in html template… how I do it ? anybody for help me ? my email: manjny@gmail.com

Leave a Reply