Hide the information schema in phpMyAdminHide the information schema in phpMyAdmin

Posted October 11th, 2008 in MySql and PHP

When you log into phpMyAdmin you can only see the databases for which you have access rights, as well as the information_schema database. It is possible to hide this database if you want to. This post looks at how to hide the information_schema database in phpMyAdmin.

phpMyAdmin's config.inc.php file has a lot of available settings and one of these is ['hide_db'] which can be specified on a server by server configuration.

Normally you would have something like this in your config.inc.php file:

/*
 * First server
 */
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = '';
$cfg['Servers'][$i]['controlpass'] = '';

It's then just a matter of adding this line underneath the above section:

$cfg['Servers'][$i]['hide_db'] = 'information_schema'; 

and the information_schema will no longer show.

If you have your phpMyAdmin configuration set up to be able to log into multiple servers you would then need to add that setting to each of the other server's settings as well.

Related posts:

Share or Bookmark

Share or Bookmark this page using the following services. You will need to have an account with the selected service in order to post links or bookmark this page.

Subscribe or Follow

Subscribe via RSS or email, or follow me on Facebook or Twitter below. The RSS icon takes you through to Feedburner where you can select the service or application to use.

Comments

blog comments powered by Disqus