MySQL phpMyAdmin 报告“无权限”

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

phpMyAdmin reports 'No Privileges'

mysqlphpmyadmineasyphp

提问by Peter

Long story short, I ended up deleting the root user from PHPMyAdmin in EasyPHP. After some researching, I used skip-grant-tables to regain database access. Now, however, I cannot do anything as the root user has 'No Privileges.'

长话短说,我最终在 EasyPHP 中从 PHPMyAdmin 中删除了 root 用户。经过一番研究,我使用skip-grant-tables 来重新获得数据库访问权限。但是,现在我不能做任何事情,因为 root 用户拥有“无特权”

That stated, when logged in as 'root,' I do, indeed, have the ability to create a database via SQL.

也就是说,当以“root”身份登录时,我确实能够通过 SQL 创建数据库。

I've tried the following, and similar:

我试过以下,和类似的:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost';
FLUSH PRIVILEGES;

Still, I can't do anything. Additionally, I have this message:

尽管如此,我也无能为力。另外,我有这条消息:

The additional features for working with linked tables have been deactivated. To find out why click here.

用于处理链接表的附加功能已被停用。要了解原因,请单击此处。

Clicking through shows:

点击显示:

$cfg['Servers'][$i]['pmadb'] ...    OK
$cfg['Servers'][$i]['relation'] ... not OK [ Documentation ]
General relation features: Disabled

$cfg['Servers'][$i]['table_info'] ...   not OK [ Documentation ]
Display Features: Disabled

$cfg['Servers'][$i]['table_coords'] ... not OK [ Documentation ]
$cfg['Servers'][$i]['pdf_pages'] ...    not OK [ Documentation ]
Creation of PDFs: Disabled

$cfg['Servers'][$i]['column_info'] ...  not OK [ Documentation ]
Displaying Column Comments: Disabled
Browser transformation: Disabled

$cfg['Servers'][$i]['bookmarktable'] ...    not OK [ Documentation ]
Bookmarked SQL query: Disabled

$cfg['Servers'][$i]['history'] ...  not OK [ Documentation ]
SQL history: Disabled

$cfg['Servers'][$i]['designer_coords'] ...  not OK [ Documentation ]
Designer: Disabled

$cfg['Servers'][$i]['tracking'] ... not OK [ Documentation ]
Tracking: Disabled

Reinstalling EasyPHP doesn't fix the problem, and nothing exists in VirtualStore (as one forum post suggested). Is there a specific MySQL file I should be looking for?

重新安装 EasyPHP 并不能解决问题,VirtualStore 中也不存在任何东西(正如一篇论坛帖子所建议的那样)。是否有我应该寻找的特定 MySQL 文件?

Any ideas? This has really put a stop to my application development.

有任何想法吗?这确实阻止了我的应用程序开发。

Thanks.

谢谢。

回答by Andrew

This was super annoying.

这太烦人了。

It appears to be a bug with phpMyAdmin.

这似乎是 phpMyAdmin 的一个错误。

Clear your browser cookies, what's happening is phpMyAdmin has "cached" the fact that you do not (or possibly didn't have at some point) create database access.

清除您的浏览器 cookie,发生的事情是 phpMyAdmin 已“缓存”了您没有(或可能在某些时候没有)创建数据库访问的事实。

There's no way to reset it other than deleting your cookies for phpMyAdmin in your browser window (to get a new 'session id'), or deleting the session files on the phpMyAdmin web server.

除了在浏览器窗口中删除 phpMyAdmin 的 cookie(以获得新的“会话 ID”)或删除 phpMyAdmin Web 服务器上的会话文件之外,没有其他方法可以重置它。

回答by cHao

If your machine has IPv6 enabled, "localhost" will resolve to ::1, rather than 127.0.0.1. This can cause issues.

如果您的机器启用了 IPv6,“localhost”将解析为::1,而不是127.0.0.1。这可能会导致问题。

Try connecting to "127.0.0.1" rather than "localhost". That ought to force mysql to authenticate by IPv4 address, so make sure 127.0.0.1 is in there.

尝试连接到“127.0.0.1”而不是“localhost”。这应该强制 mysql 通过 IPv4 地址进行身份验证,因此请确保 127.0.0.1 在那里。

Alternatively, if you have admin access, you can map localhost back to 127.0.0.1 in c:\Windows\System32\Drivers\etc\hosts.

或者,如果您具有管理员访问权限,则可以将 localhost 映射回 127.0.0.1 in c:\Windows\System32\Drivers\etc\hosts.

回答by Mark

cHao and Andrew's answers solved the problem for me. I reset all permissions in the MySQL db, user table, to yes. All dbs then reappeared in phpMyAdmin, but I had no 'create db' privilege there. Cleared the phpMyAdmin cookie and even upgraded phpMyAdmin with no success. Then I went into the tmp/php directory and deleted a session file I found there (named sess + random ascii), and success!

cHao 和 Andrew 的回答为我解决了这个问题。我将 MySQL 数据库用户表中的所有权限重置为是。然后所有 dbs 重新出现在 phpMyAdmin 中,但我在那里没有“创建 db”权限。清除了 phpMyAdmin cookie,甚至升级了 phpMyAdmin 也没有成功。然后我进入 tmp/php 目录并删除了我在那里找到的一个会话文件(名为 sess + random ascii),成功!

回答by Peter

Turns out to be some sort of issue specific to Google Chrome, as it now works in IE. I'll try running CCleaner.

原来是谷歌浏览器特有的某种问题,因为它现在可以在 IE 中使用。我会尝试运行CCleaner。

Thanks all.

谢谢大家。

回答by Ess'iele

I just experienced the same issue (lost access to my local databases). The problem does seem to be related to browsers running Gecko or similar (like KHTML... I'm on Opera). After deleting the phpMyAdmin cookie, as suggested, I still had No Privileges. So I went to localhost/xampp, then clicked on Security. On that page is a link (h-t-t-p://localhost/security/xamppsecurity.php) that took me to a page entitled Security console MySQL & XAMPP directory protection)

我刚刚遇到了同样的问题(无法访问我的本地数据库)。问题似乎与运行 Gecko 或类似浏览器(如 KHTML...我在 Opera 上)有关。按照建议删除 phpMyAdmin cookie 后,我仍然没有权限。所以我去了localhost/xampp,然后点击了安全。在该页面上有一个链接 (http://localhost/security/xamppsecurity.php),它将我带到一个名为Security console MySQL & XAMPP directory protection 的页面

I left the current passwordfield blank and entered a new password; I think I selected cookie as the PhpMyAdmin authentication method (it actually says PhpMyAdmin authentification, but hey...). Once I had submitted the password change and tried again to access phpMyAdmin, I got all my databases back and am again able to create more; the No Privilegesmessage has disappeared!

我将当前密码字段留空并输入了一个新密码;我想我选择了 cookie 作为 PhpMyAdmin 身份验证方法(它实际上说的是 PhpMyAdmin身份验证,但是嘿...)。一旦我提交了密码更改并再次尝试访问 phpMyAdmin,我就恢复了所有数据库并再次能够创建更多;在没有特权的消息已经消失了!

There is still the message at the bottom saying

底部还有消息说

The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. To find out why click here.

phpMyAdmin 配置存储未完全配置,一些扩展功能已停用。要了解原因,请单击此处。

But that's another river for another time.

但那是另一条河了。

回答by Cory C

Been stuck with this a few times over the last few years... Easiest method I've found was today whilst setting up an RPi.

在过去的几年里,我曾几次被困在这个问题上......我发现的最简单的方法是在今天设置 RPi 时。

From the terminal run: $sudo mysql_secure_installationand set up as appropriate for your implementation.

从终端运行:$sudo mysql_secure_installation并根据您的实现进行适当设置。

Then, setup user access with: $sudo mysql_setpermissionthis will allow you to set a super/root user.

然后,设置用户访问权限:$sudo mysql_setpermission这将允许您设置超级/root 用户。

Just follow the prompts.

只需按照提示操作即可。