错误原因:
是mysql8 之前的版本中加密规则是mysql_native_password,而在mysql8之后,加密规则是caching_sha2_password
解决方式:
1. cmd进入命令行进入mysql
mysql -u root -p
2. 使用mysql数据库
use mysql;
3.ALTER USER \’root\’@\’localhost\’ IDENTIFIED WITH mysql_native_password BY \’000429\’;
4.ALTER USER \’root\’@\’localhost\’ IDENTIFIED BY \’000429\’ PASSWORD EXPIRE NEVER;
5.FLUSH PRIVILEGES;
注:\’000429\’处为自己的密码。