无法将Azure Web App-NodeJS连接到Azure Mysql [英] Cannot connect Azure Web App - NodeJS to Azure Mysql

查看:120
本文介绍了无法将Azure Web App-NodeJS连接到Azure Mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Azure连接字符串(来自Azure门户)用于Node.js应用程序,但仍无法连接到Mysql服务器的Azure数据库.

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({ 主持人:yourhost, 用户:用户名", 密码:密码", 数据库:数据库", 端口:3306, ssl:{ca:fs.readFileSync(__ dirname +'/baltimore.pem')}});

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

我收到以下错误: 错误:MySQL服务器正在请求旧的且不安全的4.1之前的身份验证机制.升级用户密码或使用{insecureAuth:true}选项."

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."

但是我可以使用Mysql Benchmark相同的凭据进行连接.

But I can connect using Mysql Benchmark same credentials.

我做错了什么?

推荐答案

Azure MySQL数据库与 mysqljs不兼容连接器库.有关详细信息,请参见问题1729

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

这篇关于无法将Azure Web App-NodeJS连接到Azure Mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆