1. 程式人生 > >mysql 8.0 客戶端授權

mysql 8.0 客戶端授權

8.0不同於之前版本。

mysql8.0 之前的版本加密規則是mysql_native_password,mysql8之後,加密規則是caching_sha2_password。

解決方法把mysql使用者登入密碼加密規則還原成mysql_native_password

之前版本:

grant all privileges on *.* to 'root'@'%' identified by `12345678` with grant option;
8.0版本:
use mysql

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '12345678';

FLUSH PRIVILEGES;