"Cannot log in to the MySQL server" 没有代码在 CentOS7 上使用 phpMyAdmin

"Cannot log in to the MySQL server" without code using phpMyAdmin on CentOS7

我正在使用 Apache、MySQL 和 phpMyAdmin 设置一个新的 CentOS 7 服务器。 MySQL 和 phpMyAdmin 的安装按预期进行。 对于安装,我使用了 Digital Ocean 的以下指南:

MySQL installation guide

phpMyAdmin installation guide

在服务器上登录 MySQL 正常。 但是,当我尝试登录 phpMyAdmin 时,我只收到 "cannot log in to the MySQL server" 错误,但没有代码。

这是所有内容的全新安装,所以我不确定是什么导致了这个问题,因为我遵循了所有指南。

感谢用户 xdk over on the DigitalOcean 社区论坛。 他们说了以下内容:

Assuming MySQL 8.
ALTER USER root IDENTIFIED WITH mysql_native_password BY 'PASSWORD';
Reason:
Some applications are having trouble with caching _sha2 _password method.
Above sets the credentials to use the native one.

执行此操作成功了。