php 新用户无法登录PHPmyadmin

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5920719/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 22:52:54  来源:igfitidea点击:

New users can't login on PHPmyadmin

phploginphpmyadminprivileges

提问by GB001

I am currently having a problem with allowing multiple users to login with phpmyadmin without seeing each other's databases. I am using this method: http://alandoyle.com/tutorials/configuring-phpmyadmin-for-multiple-users/

我目前在允许多个用户使用 phpmyadmin 登录而不查看彼此的数据库时遇到问题。我正在使用这种方法:http: //alandoyle.com/tutorials/configuring-phpmyadmin-for-multiple-users/

While the method works for the most part, although when creating a New User where I check off the "Grant all privileges on wildcard name (username_%)" selection does not allow me to login with that user unless I don't specify a password and enable "$cfg['Servers'][$i]['AllowNoPassword']".

虽然该方法在大多数情况下有效,但在创建新用户时,我勾选“授予通配符名称(用户名_%)的所有权限”选项不允许我使用该用户登录,除非我不指定密码并启用“$cfg['Servers'][$i]['AllowNoPassword']”。

What I've tried:

我试过的:

I've tried to create the same User where I don't check it off, but while I can login unfortunately I can see all the root databases. As opposed to when I choose no password and I can only see databases pertaining to that user.

我试图创建相同的用户,但我不检查它,但不幸的是,虽然我可以登录,但我可以看到所有的根数据库。与当我不选择密码并且我只能看到与该用户有关的数据库时相反。

回答by user875462

EDIT: I found that setting the user to LOCALHOST only seems to have remedied this issue. Using ANYHOST does not work for local logins for some reason.

编辑:我发现将用户设置为 LOCALHOST 似乎只能解决这个问题。由于某种原因,使用 ANYHOST 不适用于本地登录。

I'm having the same issue after I changed my root password on my testing server. I can no longer connect using any new users. I'm messing around but I think it might have something to do with adding blowfish security or something.

在我的测试服务器上更改 root 密码后,我遇到了同样的问题。我无法再使用任何新用户进行连接。我在胡闹,但我认为这可能与添加河豚安全性或其他东西有关。

My PHP scripts cannot connect either. I also can't grant new users all privs. I'm not sure what I did to make this happen. I have legacy users that can achieve this.

我的 PHP 脚本也无法连接。我也不能授予新用户所有权限。我不确定我做了什么来实现这一点。我有可以实现这一目标的旧用户。

回答by itsols

You MUST have BOTH localhost and % for each user. Only then you can log-in locally AND from other hosts or client programs. This is why you find the root user having so many entries as well.

对于每个用户,您必须同时拥有 localhost 和 %。只有这样,您才能在本地和从其他主机或客户端程序登录。这就是为什么您发现 root 用户也有这么多条目的原因。

Steps to solve this:

解决这个问题的步骤:

  1. log in to phpmyadmin using root
  2. Select privileges
  3. Select the user you want to modify (i.e., to give log in privileges).
  4. If you already have given the host as any (%) now change it to localhost.
  5. Make sure you click on the option button "keep the old one" and update
  1. 使用 root 登录到 phpmyadmin
  2. 选择权限
  3. 选择要修改的用户(即授予登录权限)。
  4. 如果您已经将主机作为任何 (%) 指定,现在将其更改为 localhost。
  5. 确保单击选项按钮“保留旧的”并更新

Here's a screenshot showing the settings I'm referring to. enter image description hereNow log out and log in as the new user.

这是显示我所指的设置的屏幕截图。 在此处输入图片说明现在注销并以新用户身份登录。

回答by publikz.com

  1. You need to create mySql users
  2. You need to give mySql privileges to each user to only their databases
  3. Then I suggest you make simple form identification in phpMyAdmin
  1. 你需要创建mySql用户
  2. 您需要为每个用户仅授予他们的数据库的 mySql 权限
  3. 那我建议你在phpMyAdmin中做简单的表单识别

So all (grants) privileges, I think, must be managed from mySql, not any other way...

所以所有(授予)权限,我认为,必须从 mySql 管理,而不是任何其他方式......

回答by undisputed

When u select the rights on the new user, check the GRANT flag if you like enable user.

当您选择新用户的权限时,如果您喜欢启用用户,请检查 GRANT 标志。

回答by Dawood Najam

If it also shows password-related error then try adding this line to your phpmyadmin's config.inc.php:

如果它还显示与密码相关的错误,请尝试将此行添加到您的 phpmyadmin 的 config.inc.php 中:

$cfg['Servers'][$i]['ssl'] = true;

回答by Jordy Ubink

I am using XAMPP and the answers above didn't work. Using 'localhost' as host name was not enough. I had to create 2 accounts, like itsols explained in his answer.

我正在使用 XAMPP 并且上面的答案不起作用。使用“localhost”作为主机名是不够的。我必须创建 2 个帐户,就像他在回答中解释的 itsols 一样。

One of the users has host name 'localhost' and the other one has '::1' (which means localhost in IPv6). Only when I created both of them with the same username, I was able to login to phpmyadmin.

其中一个用户的主机名是“localhost”,另一个用户的主机名是“::1”(这意味着 IPv6 中的 localhost)。只有当我使用相同的用户名创建它们时,我才能登录到 phpmyadmin。

User accounts host names

用户帐户主机名

enter image description here

在此处输入图片说明