Wednesday, September 23, 2015

Hide default databases from phpmyadmin

Peace be upon you,
My favorite database are MySQL and PhpMyAdmin are the database administration that I use very frequently. MySQL and PhpMyAdmin comes with default configuration database such information_schema etc. Thus database that I not interact directly, I just interact with my own database set for my web application. So why not, we just hide these database from PhpMyAdmin?

Just locate and open \phpMyAdmin\config.inc.php with your favorite text editor (I use SublimeText3) and add this regex code:
/* hide database from phpmyadmin */
$cfg['Servers'][$i]['hide_db'] = '^(information_schema|performance_schema|mysql|phpmyadmin|cdcol|foo|webauth)$';

Then reload / restart your apache and mysql, and see changes on http://localhost/phpmyadmin, check it out on the left side. Now, we just see our own created database only.

Alternative way:
Open and browse "PhpMyAdmin" > Click on "Setting" tab > Then click on "Feature" tab and paste this code within "Hide database" field
^(information_schema|performance_schema|mysql|phpmyadmin|cdcol|foo|webauth)$

Thus default database are just hide from PhpMyAdmin and If you are using tool such MySQL Workbench, NaviCat, HeidiSQL,RazorSQL software or else, thus database still there and available. Hope this tips are useful. That all for now. Wassalam...

No comments:

Post a Comment