MySQL错误代码:2059
·
navicat连接mysql 8.0_2059错误
【报错原因】mysql8.0 之前的版本中加密规则是 mysql_native_password,而 mysql8.0 之后的版本加密规则是caching_sha2_password
【解决方案】修改 mysql8.0 的加密规则
# 连接 mysql 服务器
mysql -u root -p
# 进入 mysql 数据库
mysql> use mysql;
# 查看 user 表
mysql> select user,host from user;
# 设置登录密码永不过期(password改为自己的)
mysql> alter user 'root'@'localhost' identified by 'password' password expire never;
mysql> alter user 'root'@'%' identified by 'password' password expire never;
# 修改加密规则(password改为自己的)
mysql> alter user 'root'@'localhost' identified with mysql_native_password by 'password';
mysql> alter user 'root'@'%' identified with mysql_native_password by 'password';
# 刷新权限
mysql> flush privileges;
# 退出
mysql> quit
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐


所有评论(0)