const mysql = require('mysql2');
// create the connection to database
const connection = mysql.createConnection({
host: 'localhost',
user: 'root',
database: 'db',
password: ''
});
await(new Promise((resolve, reject) => {
/*Place your code here and call resolve to proceed*/
connection.connect(function (err) {
if (err) {
return console.error('error: ' + err.message);
}
console.log('Connected to the MySQL server.');
});
resolve()
}));
Nothing is being shown on logs that is no output whatsoever even for connection of mysql2 module of Node JS. Am I the only person experiencing this?