ER_NOT_SUPPORTED_AUTH_MODE-MySQL服务器 [英] ER_NOT_SUPPORTED_AUTH_MODE - MySQL server

查看:98
本文介绍了ER_NOT_SUPPORTED_AUTH_MODE-MySQL服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了一个MySQL数据库.当我尝试通过Node JS服务器访问它时,出现错误

"ER_NOT_SUPPORTED_AUTH_MODE:客户端不支持身份验证 服务器请求的协议;考虑升级MariaDB客户端"

这很奇怪,因为我已经卸载了MariaDB并使用Homebrew安装了MySQL.

这是我尝试建立连接:

var mysql = require('mysql');

var connection = mysql.createConnection({
  host     : 'localhost',
  user     : 'root',
  password : '********',
  database : 'vod_bill_database'
}); 

有什么想法吗?谢谢

我发现在某些MySQL版本中,它们对建立连接的身份验证有些混乱.我要做的就是将"insecureAuth:true"这一行添加到我的连接尝试中.

var connection = mysql.createConnection({
  host     : 'localhost',
  user     : 'root',
  password : '********',
  database : 'vod_bill_database',
  insecureAuth : true
}); 

现在工作正常.

I have setup a MySQL database. When I try to access it through my Node JS server, I am getting the error

"ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MariaDB client"

which is strange since I already uninstalled MariaDB and installed MySQL using Homebrew.

This is my attempt of connection:

var mysql = require('mysql');

var connection = mysql.createConnection({
  host     : 'localhost',
  user     : 'root',
  password : '********',
  database : 'vod_bill_database'
}); 

Any ideas? Thanks

解决方案

I figured that in some MySQL versions they have the authentication for the establishment of a connection a bit messed. All I had to do was add the line "insecureAuth : true" to my connection attempt.

var connection = mysql.createConnection({
  host     : 'localhost',
  user     : 'root',
  password : '********',
  database : 'vod_bill_database',
  insecureAuth : true
}); 

It is working fine now.

这篇关于ER_NOT_SUPPORTED_AUTH_MODE-MySQL服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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