[Solved] Error: ER_ACCESS_DENIED_ERROR: Access denied for user ‘root’@‘localhost’ (using password: YES)

Add the port number when configuring the server file

// Create the connection of database
const mysql=require('mysql')
const db=mysql.createPool({
  host:'127.0.0.1',
  port:'3307',
  user:'root',
  password:'admin123',
  database:'my_db'
})
module.exports=db

When creating a table, check the ID and increment options

Read More: