[Mysql8] root登入後沒有權限建立 & 使用舊認證方式登入
首先新的phpadmin登入時發現
caching_sha2_password以及另一個.
代表新的驗證取代了舊有的方式. 等一下我們會談到怎麼登入.
當發現root登入後不能建立新資料庫。代表權限的設定其實還沒完
-----------------------------
##XXX錯的. 舊的指令
##GRANT ALL PRIVILEGES ON *.* ‘root’@’%’ identified by ‘123123’ WITH GRANTOPTION; XXXXX
錯的
-------------------------------
1.先command 進去mysql
2.mysql -u root -p (此時是一開始先設定的
新的指令才對
3.grant all privileges on *.* to 'root'@'%'; (這樣就可以給root完整)![]()
ps:如果出現 The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
請執行 mysql> flush privileges; 後再試就可以
此時再給予登入使用舊制.
4.ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '要大寫小寫以及符號數字的密碼長度';
5.flush privileges;
完成