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版本报错 #56

Open
ghost opened this issue Nov 30, 2019 · 3 comments
Open

启动项目,mysql版本报错 #56

ghost opened this issue Nov 30, 2019 · 3 comments
Labels

Comments

@ghost
Copy link

ghost commented Nov 30, 2019

请详细描述您对本项目的任何问题,我们会在第一时间查阅和解决。
报错字段: Client does not support authentication protocol requested by server; consider upgrading MySQL client

报错图片如下

WX20191130-233144

config.js 密码已修改成本机的

mac mysql 版本
WX20191130-233047

@ghost
Copy link
Author

ghost commented Dec 1, 2019

找到原因了,mysql 8.0版本的账号密码连接默认是caching_sha2_password 这种方式连接的,所以得把密码加密方式修改成mysql_native_password 就可以连接了

@yyqq188
Copy link

yyqq188 commented May 13, 2023

请问,如何在代码层面修改密码的加密方式

@yyqq188
Copy link

yyqq188 commented May 15, 2023

mysql 8.0 更新了加密方式plugin,mysql5用的是sha256_password加密方式,mysql8用的是caching_sha2_password的加密方式,所以导致mysql8连接时报错

为了方便访问,提供在mysql8中创建原来加密方式账号的方法

首先如果root用户没有SYSTEM_USER权限,先添加权限
grant system_user on . to 'root';
flush privileges;

再执行下面的创建用户的操作
1.创建用户
create user 'username'@'%' identified by '123456';
2.用户授权
grant all privileges on . to 'username'@'%'
3.修改成原来的加密方式
alter user 'username'@'%' identified with mysql_native_password by '123456';
4.刷新MySQL系统权限相关表
flush privileges;

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

No branches or pull requests

2 participants