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中文网其他相关文章!