Home > Mobile >  Unable to connect Azure Mysql using Nodejs
Unable to connect Azure Mysql using Nodejs

Time:11-23

I came across this issue today I tried to connect and retreive data in Azure Database for MySQL by using nodejs, so now I'm just tried to test the connection but it doesnt work.

Ps: database is exists

eg:

const db = mysql.createConnection({
host: '50.xx.xx.xx',
user: 'admin',
password: 'xxxx',
database: 'admin',
port: 3306
})

enter image description here

CodePudding user response:

  • Depending on how MySQL was installed, it is possible that the default admin database was NOT created.

  • You may have to look for whitespace in database name. See if white space has been added in front or after database name.

  • Database must be created first.

  • create it in mysql with

mysql> create database admin
  • Related