Client does not support authentication protocol requested by server; consider upgrading MySQL client

出现错误 Client does not support authentication protocol requested by server; consider upgrading MySQL client

Use mistakes today typeorm connection mysql8.0.17, an error is Client does not support authentication protocol requested by server; consider upgrading MySQL client versions prior to mysql8 reason appears encryption rule is mysql_native_password, and after mysql8, encryption rules Yes. caching_sha2_password

Solution

  1. Navicat drive upgrade
  2. To restore mysql user password encryption rules to mysql_native_password

Use Method 2 to resolve

Find mysql installation location, use my homebrew installation, so you can use the Find command directly brew

brew info mysql

It can be found /usr/local/Cellar/mysql/8.0.17_1 (284 files, 272.4MB) which is the installation location, go to the bin directory under the installation directory of mysql

cd /usr/local/Cellar/mysql/8.0.17_1
cd bin
mysql -u root -p

Obtain permission to enter the password, then enter the following

ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; #修改加密规则
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; #更新一下用户的密码
FLUSH PRIVILEGES; #刷新权限

To connect again, re-enter the new account password

Guess you like

Origin www.cnblogs.com/mybilibili/p/11604558.html