Can you hide tables from a MySQL user in 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.
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:
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['hide_db'] = '^information_schema|mysql$';
This is It.
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 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.
精彩评论