赞
踩
今天新安装的mysql8,然后用Navicat连接是报错:2059
百度了下然后发现原因是高版本的MySQL更改了密码验证机制,再次更改回去即可。
Win+R打开dos命令窗口,切换到mysql的安装目录下的bin
输入命令:mysql -u root -p,执行
(如果设置密码输入设置的密码,没有直接跳过)
- C:\Program Files\MySQL\MySQL Server 8.0\bin>mysql -u root -p
- Enter password: ****
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 17
- Server version: 8.0.28 MySQL Community Server - GPL
-
- Copyright (c) 2000, 2022, Oracle and/or its affiliates.
-
- Oracle is a registered trademark of Oracle Corporation and/or its
- affiliates. Other names may be trademarks of their respective
- owners.
-
- 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 '自己的密码';
- mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
- Query OK, 0 rows affected, 1 warning (0.01 sec)
执行成功之后即可正常连接了。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。