无法登录 Centos、Google Cloud 上的 phpMyAdmin

无法登录 Centos、Google Cloud 上的 phpMyAdmin

在我的 MySQL 数据库中,我创建了两个用户,一名普通用户(拥有一个数据库的权限)和一名超级用户。当我想通过这些帐户中的任何一个登录 phpMyAdmin 时,我收到“无法登录 MySQL 服务器”错误。 (我是远程访问)

<Directory /usr/share/phpMyAdmin/>在我的文件里面/etc/httpd/conf.d/phpMyAdmin.conf

<Directory /usr/share/phpMyAdmin/>
    AddDefaultCharset UTF-8

   <IfModule mod_authz_core.c>
    # Apache 2.4
   <RequireAny>
      Require all granted
      Require ip 127.0.0.1
      Require ip ::1
   </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Allow from All
     Allow from 127.0.0.1
     Allow from ::1
   </IfModule>
</Directory>

我还在 config.inc.php 文件中为我的超级管理员提供了用户和密码。我缺少什么?我应该对谷歌防火墙做些什么吗?我还没有为 MySQL 配置防火墙规则,我现在应该配置吗?

编辑:我也尝试过这个答案:https://serverfault.com/questions/299365/cant-login-to-phpmyadmin

$cfg['blowfish_secret'] = 'myPassword'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

还是行不通

我可以通过 SSH 终端登录 MySql。但我无法使用 phpMyAdmin 登录页面。

答案1

答案可以在这篇文章的评论中找到:https://www.digitalocean.com/community/questions/cannot-log-in-to-the-mysql-server-without-code-using-phpmyadmin-on-centos7

“某些应用程序在缓存 _sha2 _password 方法时遇到问题。上面设置了使用本机凭据的凭据。” MySQL 8 可能会发生这种情况。

登录数据库后,您可以尝试以下操作:

 ALTER USER myUsername IDENTIFIED WITH mysql_native_password BY '123TheBestPassword';

相关内容