問題來源:
homebrew安裝完mysql8後,需要做一些初始化配置,關於密碼的配置如下:
There are three levels of password validation policy:
LOW Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG:
大意爲:密碼策略有三個級別,需要設置密碼策略級別;
我這裏選擇的是最低級別。
一路 "Y" 配置完成後,連接navicat客戶端,發現連接失敗:Client does not support authentication protocol requested by server;
網上查詢之後,應該是密碼策略太低的問題(加密策略?)
解決方案:
打開終端,輸入如下
mysql -uroot -p
##輸入密碼
use mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你自己的密碼';
FLUSH PRIVILEGES;
完美解決