How to hide information_schema database from phpmyadmin

寵の児 提交于 2019-12-02 20:37:30
CatholicForEver

You can even hide multiple DBs using pipe separator

$cfg['Servers'][$i]['hide_db'] = 'information_schema|performance_schema|mysql';

I installed phpmyadmin in outside directory but and these methods didn't work for me.

Open phpmyadmin

Settings > Features > General > database > Hide databases

Enter Database that you want to hide as following

information_schema|performance_schema|mysql

In case you also want to restrict users from accessing the information_schema from a url like you posted and you are not satisfied with hide_db configuration directive then you may add the following line in config.inc.php file of phpmyadmin.

if($_GET['db'] == 'information_schema')exit;

I'd write this comment on the highest upvoted answer, but I don't have enough reputation yet.

When specifying multiple databases, keep in mind it operates under RegEx rules (as the help states). So while it may be unlikely, putting "information_schema|performance_schema|mysql" will also hide any DB's that contain these strings.

Instead, put "^information_schema|performance_schema|mysql$". In regular expressions, ^ denotes the beginning of the string, and $ denotes the end.

This means you can also hide databases by partial string. While you should always control database access by MySQL user permissions, you can hide groups of DB's using partial matching. For example if you didn't want all your test databases visible, you could put "^test_" in the hidden databases field and it will hide all databases that start with test_. EG test_123, test_456.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!