MySQL phpmyadmin 不显示“权限”选项卡

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14699195/
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-31 16:25:05  来源:igfitidea点击:

Phpmyadmin doesn't show "privileges" tab

mysqlphpmyadminwampprivileges

提问by Kevin Pei

I have WAMP installed on Windows, and I can't seem to get the "privileges" tab to show in PhpMyAdmin no matter what. Reading other forum discussions and articles, I have done the following:

我在 Windows 上安装了 WAMP,无论如何我似乎都无法在 PhpMyAdmin 中显示“权限”选项卡。阅读其他论坛讨论和文章,我做了以下工作:

  • Checked to make sure that I'm logged in as root
  • Reinstalled wamp
  • Reset my mysql users
  • Run mysql check on users
  • Cleared my cache
  • 检查以确保我以 root 身份登录
  • 重新安装 wamp
  • 重置我的 mysql 用户
  • 对用户运行 mysql 检查
  • 清除了我的缓存

Through those tests, I have gotten the following error: Can't find file: 'user' (errno: 2). A google search for a solution to that proved futile. Any help would be appreciated

通过这些测试,我得到了以下错误:Can't find file: 'user' (errno: 2). 谷歌搜索解决方案被证明是徒劳的。任何帮助,将不胜感激

Update: Screenshotenter image description here

更新:截图在此处输入图片说明

Thanks

谢谢

采纳答案by skytreader

If you are sure that you are running as root, try clearing your cookies then refresh. This, AFAIK, is a bug affecting Google Chrome in particular but I can't say for certain for other browsers. Note that you can select what cookies to delete via the developers tab in Chrome. You need to delete only the localhost cookies.

如果您确定以 root 身份运行,请尝试清除 cookie,然后刷新。这个,AFAIK,是一个特别影响谷歌浏览器的错误,但我不能肯定其他浏览器。请注意,您可以通过 Chrome 中的开发人员选项卡选择要删除的 cookie。您只需要删除 localhost cookie。

Edit:

编辑:

Oh no. So you've really deleted the 'user' table. My suggestion is that you either find CREATE scripts for the tables in database mysqlor do a complete reinstall (as it appears, you don't have much DB's to lose anyway). Just for the record:

不好了。所以你真的删除了“用户”表。我的建议是,您要么为数据库中的表找到 CREATE 脚本,要么mysql完全重新安装(看起来,无论如何您都不会丢失太多数据库)。仅作记录:

mysql> USE mysql;
Database changed
mysql> SHOW TABLES;
+---------------------------+
| Tables_in_mysql           |
+---------------------------+
| columns_priv              |
| db                        |
| event                     |
| func                      |
| general_log               |
| help_category             |
| help_keyword              |
| help_relation             |
| help_topic                |
| host                      |
| ndb_binlog_index          |
| plugin                    |
| proc                      |
| procs_priv                |
| proxies_priv              |
| servers                   |
| slow_log                  |
| tables_priv               |
| time_zone                 |
| time_zone_leap_second     |
| time_zone_name            |
| time_zone_transition      |
| time_zone_transition_type |
| user                      |
+---------------------------+
24 rows in set (0.00 sec)

回答by Night Owl

For people who run into this problem while using cPanel / WHM the post linked to below on the cPanel site states:

对于在使用 cPanel / WHM 时遇到此问题的人,cPanel 站点上链接到下面的帖子指出:

Per internal case number 37402, the functionality to add/delete/rename users and databases through phpMyAdmin has been removed because of the database mapping feature.

根据内部案例编号 37402,由于数据库映射功能,通过 phpMyAdmin 添加/删除/重命名用户和数据库的功能已被删除。

That means the Users / Privileges tab has been removed from cPanel's version of phpMyAdmin and it doesn't sound like it's coming back. The post is from December of 2013.

这意味着用户/权限选项卡已从 cPanel 的 phpMyAdmin 版本中删除,并且听起来好像不会回来了。该帖子来自 2013 年 12 月。

http://forums.cpanel.net/f354/phpmyadmin-users-tab-gone-367661.html

http://forums.cpanel.net/f354/phpmyadmin-users-tab-gone-367​​661.html

The cPanel staff member cPanelMichael who answered the post recommended two alternatives.

回答该帖子的 cPanel 工作人员 cPanelMichael 推荐了两种替代方案。

  1. Use "Home > SQL Services > Database Map Tool." This appears to be missing major functionality provided by phpMyAdmin.
  2. Install your own standalone version of phpMyAdmin and use that instead of the cPanel version.
  1. 使用“主页 > SQL 服务 > 数据库映射工具”。这似乎缺少 phpMyAdmin 提供的主要功能。
  2. 安装您自己的 phpMyAdmin 独立版本并使用它而不是 cPanel 版本。

You gotta love progress.

你必须热爱进步。

回答by Troy

This one took me a long time to figure out as well as 'root' log in wasn't helping.

这个我花了很长时间才弄明白,而且“root”登录也没有帮助。

logged out and logged back in:

注销并重新登录:

This time I put rootas the username

这次我把root作为用户名

And use the same password as my user account and I was given access.

使用与我的用户帐户相同的密码,我获得了访问权限。

This is what worked for me.

这对我有用。

回答by jave.web

I solved the problem like this:

我解决了这样的问题:

1) I set a root password through SQL query like this:

1)我通过这样的SQL查询设置了root密码:

  • On a main page you should see the current root user - usually root@localhost
  • So query for password change:
    SET PASSWORD FOR 'root'@'localhost' = PASSWORD('YOURPASSWORDHERE');
  • 在主页上,您应该看到当前的 root 用户 - 通常 root@localhost
  • 所以查询密码更改:
    SET PASSWORD FOR 'root'@'localhost' = PASSWORD('YOURPASSWORDHERE');

2) Search for config.inc.phpin your wamp/xampp folder and change auth_type:

2)config.inc.php在您的 wamp/xampp 文件夹中搜索并更改auth_type

  • you may find more of those configs, however the one you need is the one that contains line:
    $cfg['Servers'][$i]['auth_type'] = 'SOMETHING';- change 'SOMETHING'to 'cookie'
    So you get: $cfg['Servers'][$i]['auth_type'] = 'cookie';(or http if you wish) -
  • 您可能会找到更多这样的配置,但是您需要的是包含以下行的配置:
    $cfg['Servers'][$i]['auth_type'] = 'SOMETHING';- 更改'SOMETHING''cookie'
    So you get:($cfg['Servers'][$i]['auth_type'] = 'cookie';或 http 如果您愿意)-

3) clear/delete all browser cookies for your server (usually look for localhost or 127.0.0.1 cookies)

3) 清除/删除服务器的所有浏览器 cookie(通常查找 localhost 或 127.0.0.1 cookie)

4) Go to phpyadmin's webpage again - now you will be prompted with login box (html or http - depends on whether you set the cookie or http)

4)再次进入phpyadmin的网页——现在会提示登录框(html或http——取决于你设置的是cookie还是http)

5) LOGIN - AND YOU'RE DONE ! :)Suddenly 'Privileges'/'Users' tab is shown, the exit button appears suddenly too ! :) (next to the "little house"-left-top)

5)登录 - 你就完成了!:)突然显示“权限”/“用户”选项卡,退出按钮也突然出现!:)(在“小房子”旁边-左上角)



PS: config.inc.phpcontains more interesting settings :)



PS:config.inc.php包含更多有趣的设置:)

回答by Eric Hotinger

Can you go into your Userstab at the top and edit your users (root, admin, any, whatever) by clicking on "Edit Privileges" and then under Administration, click grant?

您能否进入Users顶部的选项卡并通过单击“编辑权限”然后在“管理”下单击来编辑您的用户(rootadminany、 等等)grant

回答by Abhay Tomar

You must be logging in as "localhost"@ phpmyadmin page

您必须在日志记录“本地主机”@ phpMyAdmin的网页

there are limited privilegesgiven to the "localhost"user

有限的特权给予“localhost”的用户

where as if you login in as "root" without any password you'll have all the privilages and then you will see the user tab there on the phpmyadim homepage

就像您在没有任何密码的情况下以“root”身份登录一样,您将拥有所有特权,然后您将在 phpmyadim 主页上看到用户选项卡

回答by Arvind GK

Follow the root password change if you dont know the root password and then login in, it worked for me.

如果您不知道 root 密码,请按照 root 密码更改然后登录,它对我有用。

To change the mysql password for the root user, do the following:

要更改 root 用户的 mysql 密码,请执行以下操作:

  1. unload mysqld.nlm
  2. at the console, type: mysqld_safe --skip-grant-tables --autoclose
  3. at the server console type mysql
  1. 卸下 mysqld.nlm
  2. 在控制台输入: mysqld_safe --skip-grant-tables --autoclose
  3. 在服务器控制台类型 mysql

This will bring you to the mysql prompt. At this prompt type the following: (Where ******** is the new password, NOTE: the single quotes ARE REQUIRED)

这将带您进入 mysql 提示符。在此提示下键入以下内容:(其中 ******** 是新密码,注意:单引号是必需的)

mysql> UPDATE mysql.user SET Password=PASSWORD('********') WHERE User='root';
mysql> FLUSH PRIVILEGES;

Flush privileges will make the change take effect immediately.

刷新权限将使更改立即生效。

You can, in MySQL Version 3.22 and above, use the SET PASSWORD statement: (Where ******** is the new password, NOTE: the single quotes ARE REQUIRED)

您可以在 MySQL 3.22 及更高版本中使用 SET PASSWORD 语句:(其中 ******** 是新密码,注意:单引号是必需的)

shell> mysql -u root mysql
mysql> SET PASSWORD FOR root=PASSWORD('********');

Another way to set the password is by using the mysqladmin command: (Where ******** is the new password)

另一种设置密码的方法是使用 mysqladmin 命令:(其中 ******** 是新密码)

shell> mysqladmin -u root password ********
shell> mysqladmin flush-privileges

回答by Rav

Truly, only one thing has worked for me. rootwith blank password didn't work even with AllowNoPassword option. Notice that you could do grant create(instead of grant all) to grant only create tablepermissions. I want all permissions as it's for my local development.

确实,只有一件事对我有用。root即使使用 AllowNoPassword 选项,空白密码也不起作用。请注意,您可以执行grant create(而不是grant all)以仅授予创建表权限。我想要所有权限,因为它用于我的本地开发。



My solution, it will give all you privileges there are for given user (make sure phpmyadminis your username that you're able to log in with):

我的解决方案,它将为给定用户提供所有权限(确保phpmyadmin您的用户名是您能够登录的):

sudo mysql

sudo mysql

mysql> grant all on *.* to phpmyadmin@localhost; mysql> flush privileges; mysql> exit

mysql> grant all on *.* to phpmyadmin@localhost; mysql> flush privileges; mysql> exit



Then logout from PhpMyAdmin, log in again and you have all privileges.

然后从 PhpMyAdmin 注销,再次登录,您将拥有所有权限。

回答by Abdelhafid Chetouani

For me I've added this to the "config.inc.php" and it works well:

对我来说,我已将其添加到“config.inc.php”中,并且效果很好:

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