Code Scraps: Hide system MySQL databases from phpMyAdmin listings

Here’s a quick code scrap to hide the system MySQL and phpMyAdmin databases from being listed within the web application itself.

Open your phpMyAdmin’s config.ini.php file and locate the end of the Servers declaration. On a default install it usually has the following line at the end:

/* End of servers configuration */

After that line (or before for neatness) add the following line:

$cfg[‘Servers’][$i][‘hide_db’] = “^(information_schema|performance_schema|mysql|phpmyadmin)$”;

Save the changes to the file and refresh phpMyAdmin. You should now see that the mysql, phpmyadmin and _schema databases are removed from your web application.

If I ever need to edit the system databases I normally do it from within MySQL Workbench.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.