MySQL 8.0 的發布引入了強密碼要求,導致存取 phpMyAdmin 時出現問題。不過,有幾種方法可以解決這個問題。
執行以下命令更改驗證外掛程式:
ALTER USER root IDENTIFIED WITH mysql_native_password BY 'PASSWORD';
使用以下命令更改外掛程式:
mysql -u root -pPASSWORD ALTER USER root IDENTIFIED WITH mysql_native_password BY 'PASSWORD';
如果使用mysql/mysql-server Docker 鏡像,執行:
docker exec -it mysql sed -i -e 's/# default-authentication-plugin=mysql_native_password/default-authentication-plugin=mysql_native_password/g' /etc/my.cnf
應用插件更改with:
docker exec -it mysql mysql -u root -pPASSWORD -e "ALTER USER root IDENTIFIED WITH mysql_native_password BY 'PASSWORD';"
在MySQL容器:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
以上是MySQL 8.0 強密碼要求後如何存取 phpMyAdmin?的詳細內容。更多資訊請關注PHP中文網其他相關文章!