var connection = mysql.createConnection({     
  host     : 'localhost'.user     : 'root'.password : '123456'.port: '3306'.database: 'test' 
}); 
Copy the code

Be sure to add a ↓ port number

port: '3306'.Copy the code