Cannot connect Azure Web App - NodeJS to Azure Mysql

谁都会走 提交于 2019-12-20 05:39:26

问题


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 ?


回答1:


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



来源:https://stackoverflow.com/questions/44210615/cannot-connect-azure-web-app-nodejs-to-azure-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!