更改为/etc/phpmyadmin/config.inc.inc.php没有效果

发布于 2025-01-28 15:29:25 字数 1001 浏览 3 评论 0原文

我想配置PhpMyAdmin,仅通过一个用户访问一个数据库。

我以前曾尝试使用此答案从2013年开始使用此答案来限制访问权限,但它无效:
块访问单个数据库

phpmyadmin 在此答案中说明:
phpmyadmin中的用户帐户?

,但它也无法正常工作。我继续访问所有用户。我已经阅读了文档,并在config.inc.php中重写了

$cfg['Servers'][$i]['AllowDeny']['order'] = 'deny,allow';
$cfg['Servers'][$i]['AllowDeny']['rules'] = array(
'deny root from all',
'deny user1 from all',
'deny user2 from all',
'allow user3 from all',
);

user1和user2是用户的用户,而用户2是用户允许的。但是我仍然可以与所有用户访问。因此,我仅尝试了

$ cfg ['server'] [$ i] ['allydeny'] ['order'] ='equallicit';

应该阻止所有用户的访问,但是我仍然可以访问与所有用户。因此,我认为/etc/phpmyadmin/config.inc.php以某种方式被覆盖,因为没有变化有效,但我不明白如何。

关于检查哪里有任何想法吗?

I would like to configure PhpMyAdmin to access only one database through one user.

I tried before to restrict access via .htaccess using this answer from 2013 but it did not work:
phpMyAdmin Block Access to Single Database

I hence tried by adding deny,allow rules as stated in this answer:
How do I restrict access to specific database user accounts in phpMyAdmin?

But it did not work too. I continue to access all users. I have read the documentation and rewrote the lines in config.inc.php as

$cfg['Servers'][$i]['AllowDeny']['order'] = 'deny,allow';
$cfg['Servers'][$i]['AllowDeny']['rules'] = array(
'deny root from all',
'deny user1 from all',
'deny user2 from all',
'allow user3 from all',
);

where user1 and user2 are users to deny, and user2 is user to allow. But I can still access with all users. I hence tried only

$cfg['Servers'][$i]['AllowDeny']['order'] = 'explicit';

that should block access to all users, but I can still access with all users. I hence believe that /etc/phpmyadmin/config.inc.php is being overwritten in some way, since no change has effect, but I do not understand how.

Any idea on where to check?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

风和你 2025-02-04 15:29:25

就我而言,通过将PHP和PHPMyAdmin更新为最新版本来解决。 po,问题已经消失了

In my case, it is solved by updating PHP and PhpMyAdmin to the latest version. Poof, the problem is gone

红衣飘飘貌似仙 2025-02-04 15:29:25

看起来您允许访问所有用户,然后您再次尝试限制某些用户,似乎有些困惑。

$cfg['Servers'][$i]['AllowDeny']['order'] = 'deny,allow';

正确的模式应拒绝访问所有用户,然后向特定用户提供明确的访问权限,

$cfg['Servers'][$i]['AllowDeny']['order'] = 'explicit';

请参考官方文档
https://docs.phpmyadmin.net/en/latest/config.html# cfg_servers_allowdeny_order

正确的配置应该是这样的希望,

$cfg['Servers'][$i]['AllowDeny']['order'] = 'explicit';
$cfg['Servers'][$i]['AllowDeny']['rules'] = [
    'allow user3 from all'
];

希望它对您有用!

Looks like you are allowing access to all users and then again you are trying to restrict some of the users, seems bit confusing.

$cfg['Servers'][$i]['AllowDeny']['order'] = 'deny,allow';

The correct pattern should be deny access to all users and then provide explicit access to the specific user

$cfg['Servers'][$i]['AllowDeny']['order'] = 'explicit';

Please refer the official document
https://docs.phpmyadmin.net/en/latest/config.html#cfg_Servers_AllowDeny_order

The correct configuration should be something like this

$cfg['Servers'][$i]['AllowDeny']['order'] = 'explicit';
$cfg['Servers'][$i]['AllowDeny']['rules'] = [
    'allow user3 from all'
];

hope it works for you!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文