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
})
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