Skip to content

我提供一个我构建这个项目本地版遇到的问题,mysql的版本导致数据库连接不上 #2

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

Open
chuaan opened this issue Jan 10, 2019 · 1 comment

Comments

@chuaan
Copy link

chuaan commented Jan 10, 2019

因为mysql8.0修改用户的密码加密格式由mysql_native_password改为了caching_sha2_password。
所以我的8.0的数据库无法链接成功,可以创建一个新的用mysql_native_password的用户。并给予这个用户root权限,光单个数据库权限不够。

@fx-sun
Copy link

fx-sun commented Oct 6, 2023

修改用户密码安全加密方式

alter user 'zhangsan'@'localhost' identified with mysql_native_password by '123456';

8.0下创建用户通过mysql_native_password加密的方式

create user 'zhangsan'@'localhost' identified with mysql_native_password by '123456';

查看加密的方式以及是否有设置过期策略

select host,user,password_expired,plugin from mysql.user where user in ('root','zhangsan');
+-----------+----------+------------------+-----------------------+
| host | user | password_expired | plugin |
+-----------+----------+------------------+-----------------------+
| localhost | root | N | caching_sha2_password |
| localhost | zhangsan | N | mysql_native_password |
+-----------+----------+------------------+-----------------------+
2 rows in set (0.00 sec)

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

2 participants