NodeJS MySQL客户端不支持身份验证协议

时间:2018-06-24 09:58:15

标签: mysql node.js database backend

当我尝试与mysql 8.0连接时,出现此错误。我怎样才能解决这个问题 ?

code: 'ER_NOT_SUPPORTED_AUTH_MODE',
errno: 1251,
sqlMessage: 'Client does not support authentication protocol requested by server; 
consider upgrading MySQL client',
sqlState: '08004',
fatal: true

3 个答案:

答案 0 :(得分:7)

尝试如下更改密码:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'your new password'; 
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your new password';

答案 1 :(得分:2)

 override fun onMovieCategoryItemSelected(selectedItem:MovieCategory) {
 //        iterate current list of the adapter
    check for the item in the list where id == selectedItem
    for this item set iselected = true 
    else false
    now call diffutils update
  }

“密码”是您必须更改已经拥有的密码,否则您将修改它以使用新密码

答案 2 :(得分:-3)

如果在更改Mysql端口后发生了错误,则应该执行以下操作:

  • 端口:端口号 添加到您的mysql连接。 它对我有用