Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

连接mysql数据库报错:ER_NOT_SUPPORTED_AUTH_MODE #42

Open
momodiy opened this issue May 14, 2018 · 4 comments
Open

连接mysql数据库报错:ER_NOT_SUPPORTED_AUTH_MODE #42

momodiy opened this issue May 14, 2018 · 4 comments

Comments

@momodiy
Copy link

momodiy commented May 14, 2018

背景

我已经安装好了mysql(MAC)并配置了全局变量,使用idea内置的mysql连接工具测试连接成功。
idea-connection
使用命令行工具测试连接成功
terminal-connection

连接代码

let store = new MysqlSession({ 
    user: 'root',
    password: '12345678',
    database: 'test',
    host: '127.0.0.1',
    port: 3306,
    insecureAuth: true
})

错误信息

(node:2837) UnhandledPromiseRejectionWarning: Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
    at Handshake.Sequence._packetToError (/Users/stevenlee/github/test/koa2-note/demo/mysql/node_modules/mysql/lib/protocol/sequences/Sequence.js:52:14)
    at Handshake.ErrorPacket (/Users/stevenlee/github/test/koa2-note/demo/mysql/node_modules/mysql/lib/protocol/sequences/Handshake.js:130:18)
    at Protocol._parsePacket (/Users/stevenlee/github/test/koa2-note/demo/mysql/node_modules/mysql/lib/protocol/Protocol.js:279:23)
    at Parser.write (/Users/stevenlee/github/test/koa2-note/demo/mysql/node_modules/mysql/lib/protocol/Parser.js:76:12)
    at Protocol.write (/Users/stevenlee/github/test/koa2-note/demo/mysql/node_modules/mysql/lib/protocol/Protocol.js:39:16)
    at Socket.<anonymous> (/Users/stevenlee/github/test/koa2-note/demo/mysql/node_modules/mysql/lib/Connection.js:103:28)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    --------------------

sessionmysql两个模块下连接mysql都遇到了这个问题,使用的node包分别为koa-mysql-sessionmysql.

注:我只修改了数据库连接的配置信息。

上网查了好久都没解决,如果哪位大神有什么好的思路,跪求分享,不胜感激:ambulance:

@momodiy momodiy changed the title 链接mysql数据报错 连接mysql数据库报错:ER_NOT_SUPPORTED_AUTH_MODE May 14, 2018
@wendesun
Copy link

wendesun commented Oct 9, 2019

我也是同样的问题

@ddshiyu
Copy link

ddshiyu commented Nov 25, 2020

@jokereven
Copy link

@JuanJuanZhang123
Copy link

JuanJuanZhang123 commented Jul 18, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants