可以在 phpMyAdmin 中对 MySQL 用户隐藏表吗?
我在数据库中添加了一个 MySQL 用户,我想阻止该用户查看某些表。
我可以通过 MySQL 限制他们的权限,阻止他们运行 DROP 或 ALTER 等语句。但是是否可以阻止他们查看 phpMyAdmin 中的某些表?
如果没有 MySQL 权限来控制它(我不认为会有),那么 phpMyAdmin 中是否有一个配置允许这样做?
我知道这里的一种解决方法是将表移动到它们未添加到的新数据库中。这不是我的应用程序的选项。
I have a MySQL user added to a database that I would like to prevent from viewing certain tables.
I can limit their privileges through MySQL by preventing them from running statements like DROP or ALTER. But is it possible to prevent them from viewing certain tables in phpMyAdmin?
If there isn't a MySQL privilege that controls this (I wouldn't imagine there would be), is there a configuration in phpMyAdmin that allows this?
I understand one workaround here is to move the tables to a new database that they're not added to. This isn't an option for my application.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,您可以在 phpmyadmin 中隐藏特定数据库。
为此,只需在网络服务器根目录或其所在位置的 phpmyadmin 目录中打开 config.inc.php 即可。或搜索config.inc.php
如果您想隐藏information_schema和mysql,请在以下位置添加此行:
就是这样。
Yes, you can hide a particular database in phpmyadmin.
In order to do that, just open config.inc.php in your phpmyadmin directory in your webserver root or where it is placed. or search for config.inc.php
if you want to hide information_schema and mysql add this line after:
This is It.
您可以将表移动到另一个数据库,然后限制用户帐户只能访问具有公共表的 1 个数据库。尝试修改 phpmyadmin 将是一个巨大的错误,用户只需编写自定义查询来访问表,这就是一个非常简单的黑客攻击。
这必须在数据库端完成,否则绝对没有意义。 SE-Postgresql 是我所知道的唯一允许逐表权限的项目。这是唯一可以做到这一点的数据库,因为非常很少有人需要此功能。
You could move the tables to another database and then restrict the user account to only access the 1 database with the public tables. Trying to modify phpmyadmin would be a massive mistake, the user could just write a custom query to access the tables, thats a dead simple hack.
This has to be done on the database side or there is absolutely no point. SE-Postgresql is the only project i know of that allows for table by table permissions. This is the only database that can do this because very few people need this feature.
phpMyAdmin 以特定 MySQL 用户身份连接到数据库。如果该用户对给定表没有任何权限,则 phpMyAdmin 用户无法访问该表。当然,这适用于所有 mypMyAdmin 用户。
phpMyAdmin connects to the database as a certain MySQL user. If that user does not have any permissions on the given tables no phpMyAdmin user can access that. That would hold for all mypMyAdmin users of course.