f you are looking to batch process your data into MySQL using bulk operations, then this post is for you. This is a sequel to my  earlier post, where-in we learned how to install node, MySQL and then connect and query the MYSQL database using Node. For this tutorial, you will need to have node and MySQL already installed on your machine. So let’s get started with our bulk operations.

Firstly, we need to connect to our MySQL database.

const mysql = require('mysql');
const connection = mysql.createConnection({
  host: 'localhost',
  user: 'user',
  password: 'password',
  database: 'database name'
});
connection.connect((err) => {
  if (err) throw err;
  console.log('Connected!');
});

Once we are connected with our database, we can start querying it. We already saw how to perform simple queries on our database in the earlier post, now let’s move ahead to bulk operations.

#querying #mysql #nodejs #bulk #node

Bulk Operation into MySQL with NodeJS
1.45 GEEK