Hide 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:
- Listing MySQL tables with PHP (Thursday, April 9th 2009)
- How to tell which storage engine a MySQL table uses (Tuesday, January 13th 2009)
- Hide selected databases in phpMyAdmin (Tuesday, October 21st 2008)
- phpMyAdmin (Wednesday, December 10th 2003)
Subscribe / Follow / Email / Bookmark / Share
Use the buttons below to subscribe to my RSS feed to be notified next time something is posted, share this post with others, or subscribe by email to have my posts sent in a daily email, follow me on Twitter or follow me on Facebook.
At least one new post is usually made every day. See my posting schedule for more details.
