[SOLVED] Anyone know how i can hide tables in PHPMyAdmin?

Issue

I would like to hide some of these tables in my database. So i can make it look a little cleaner and simpler. i’ve been looking the web all over but cant find how. Does Anyone here know how can i do this? I’ve seen on youtube someone doing this but he never showed how he did it.
enter image description here

Solution

You certainly can do this, but it might take a little additional configuration if you haven’t already set up the advanced storage.

Within phpMyAdmin, certain advanced features can be enabled by configuring an additional database for it to use for storing information. Those features include things like bookmarked queries, customizing the interface, and hiding tables. This is called the phpMyAdmin configuration storage database.

Creating the phpMyAdmin configuration storage database

Technically, you can create the tables in any database, and phpMyAdmin can even try to create them for you, but it’s usually simplest for me to configure everything manually. Detailed directions are in the phpMyAdmin documentation, but basically pick a database (phpmyadmin is suggested), import the file sql/create_tables.sql from your phpMyAdmin directory (editing the first few lines if you use a different database name), and (optionally, but encouraged) create an additional use for phpMyAdmin to use, called the controluser:

For any MariaDB version:

CREATE USER 'pma'@'localhost' IDENTIFIED VIA mysql_native_password USING 'pmapass';
GRANT SELECT, INSERT, UPDATE, DELETE ON `<pma_db>`.* TO 'pma'@'localhost';

For MySQL 8.0 and newer:

CREATE USER 'pma'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'pmapass';
GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db>.* TO 'pma'@'localhost';

For MySQL older than 8.0:

CREATE USER 'pma'@'localhost' IDENTIFIED WITH mysql_native_password AS 'pmapass';
GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db>.* TO 'pma'@'localhost';

Please substitute your own password, database name, and hostname if ‘localhost’ is not appropriate (if you aren’t sure, localhost is probably correct).

Finally, edit the phpMyAdmin configuration file, config.inc.php to tell phpMyAdmin about all these tables, using your new controluser username and password:

$cfg['Servers'][$i]['controluser']       = 'pma';
$cfg['Servers'][$i]['controlpass']       = 'changeme';
$cfg['Servers'][$i]['pmadb']             = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable']     = 'pma__bookmark';
$cfg['Servers'][$i]['relation']          = 'pma__relation';
$cfg['Servers'][$i]['table_info']        = 'pma__table_info';
$cfg['Servers'][$i]['table_coords']      = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages']         = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info']       = 'pma__column_info';
$cfg['Servers'][$i]['history']           = 'pma__history';
$cfg['Servers'][$i]['tracking']          = 'pma__tracking';
$cfg['Servers'][$i]['designer_coords']   = 'pma__designer_coords';
$cfg['Servers'][$i]['userconfig']        = 'pma__userconfig';
$cfg['Servers'][$i]['recent']            = 'pma__recent';
$cfg['Servers'][$i]['favorite']          = 'pma__favorite';
$cfg['Servers'][$i]['table_uiprefs']     = 'pma__table_uiprefs';
$cfg['Servers'][$i]['users']             = 'pma__users';
$cfg['Servers'][$i]['usergroups']        = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding']  = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches']     = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns']   = 'pma__central_columns';
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates']  = 'pma__export_templates';
$cfg['Servers'][$i]['progress']          = 'pma__progress';

Hiding tables

Now, you should have your full configuration options available, including hidden tables. On the left, in the navigation pane, any navigation item (tables, procedures, etc; even entire headings where applicable) should have a small icon to the right. Hide icon

Clicking that icon immediately hides the item. Now the database gets an eye icon showing that some item is hidden: Something is hidden

Clicking the eye icon will bring up a dialog allowing you to see what items in that database are hidden and allow you to show them.

It’s pretty easy once you have the database configured for the advanced features. I should also point out that this just hides the table from the navigation pane and users could still directly execute SQL statements on hidden items — it shouldn’t be used as a replacement for proper permissions in a shared environment.

Answered By – Isaac Bennetch

Answer Checked By – Senaida (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published.