You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
因为mysql8.0修改用户的密码加密格式由mysql_native_password改为了caching_sha2_password。
所以我的8.0的数据库无法链接成功,可以创建一个新的用mysql_native_password的用户。并给予这个用户root权限,光单个数据库权限不够。
The text was updated successfully, but these errors were encountered: