Ruslan Safarov
Ruslan Safarov

Reputation: 13

Cannot connect Azure Web App - NodeJS to Azure Mysql

I am using azure connection string (from Azure portal) for Node.js app, still cannot connect to Azure Database for Mysql server.

var conn = mysql.createConnection({ host: yourhost, user: "username", password: "password", database: "database", port: 3306, ssl:{ca:fs.readFileSync(__dirname + '/baltimore.pem')}});

I get following error: "Error: MySQL server is requesting the old and insecure pre-4.1 auth mechanism.Upgrade the user password or use the {insecureAuth: true} option."

But I can connect using Mysql Benchmark same credentials.

What I am doing wrong ?

Upvotes: 0

Views: 1562

Answers (1)

Bradley Grainger
Bradley Grainger

Reputation: 28162

Azure Database for MySQL is incompatible with the mysqljs connector library. See issue 1729 for details and pull 1730 for a workaround.

Upvotes: 0

Related Questions