当前位置:   article > 正文

连接mysql报2059错_MySQL连接2059错误解决方法_mysql连接报错2059

mysql连接报错2059

今天新安装的mysql8,然后用Navicat连接是报错:2059

百度了下然后发现原因是高版本的MySQL更改了密码验证机制,再次更改回去即可。

Win+R打开dos命令窗口,切换到mysql的安装目录下的bin

输入命令:mysql -u root -p,执行

(如果设置密码输入设置的密码,没有直接跳过)

  1. C:\Program Files\MySQL\MySQL Server 8.0\bin>mysql -u root -p
  2. Enter password: ****
  3. Welcome to the MySQL monitor. Commands end with ; or \g.
  4. Your MySQL connection id is 17
  5. Server version: 8.0.28 MySQL Community Server - GPL
  6. Copyright (c) 2000, 2022, Oracle and/or its affiliates.
  7. Oracle is a registered trademark of Oracle Corporation and/or its
  8. affiliates. Other names may be trademarks of their respective
  9. owners.
  10. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

然后在登录到mysql的状态下,输入下面的命令

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '自己的密码';

  1. mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
  2. Query OK, 0 rows affected, 1 warning (0.01 sec)

执行成功之后即可正常连接了。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/320898
推荐阅读
相关标签
  

闽ICP备14008679号