Mobile app version of vmapp.org
Login or Join
Phylliss660

: PhpMyAdmin: Remove Table Drop and Empty Controls I'm not sure this is the place to post this as there are very few questions tagged phpMyAdmin; I thought of stackoverflow, but it's not really

@Phylliss660

Posted in: #Mysql #Phpmyadmin

I'm not sure this is the place to post this as there are very few questions tagged phpMyAdmin; I thought of stackoverflow, but it's not really programming. In any case, mods should feel free to move this to whatever SE site is appropriate...

I'm looking for a configuration option that would hide the Drop and Empty tabs in the Table screens. I've looked at the documentation and there are all kinds of config options, even down to letting you change the background colors of the various panes. Fun, but not as useful as controlling access to the Drop and Empty table tables would be...

Can anyone point me to where I can change this? I know I've worked on hosted servers that had those tabs hidden, so it has to be possible somehow.

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Phylliss660

3 Comments

Sorted by latest first Latest Oldest Best

 

@Cofer257

Firstly, phpMyAdmin colours those tabs in red to attempt to avoid clicks, and when you click them you will either get a Javascript confirmation alert or go to another page that has the confirmation. So it's very difficult to accidentally drop an entire table.

If that's still not satisfactory I would suggest editing the CSS. You'll need to edit the file themes/original/css/theme_right.css.php (or a different folder instead of original if that's not your theme). Add this near the top, after the first PHP section:

.tabcaution { display: none; }


UPDATE: As of version 3.4.0, PHPMyAdmin appears to have removed those buttons from the main menu and they are now under the Operations page for each table.

10% popularity Vote Up Vote Down


 

@Nimeshi995

Since you want to avoid accidentally clicking drop and empty, create a user without drop and empty privileges for accessing the database from inside phpmyadmin. That seems a bit easier than trying to remove those tabs from code.

10% popularity Vote Up Vote Down


 

@Gretchen104

The only way I can think of is to edit the php. I've found what looks like the code that generates those in db_structure.php (this is 3.3.7). Look for lines with the words TRUNCATE and DROP in them.

One reason that those hosted servers had them hidden could be because the database user didn't have the privileges to do that, but I can't see anything in the code to check those privileges, so maybe the hosting companies edited the php too.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme