phpMyAdmin woes

I use phpMyAdmin for managing many of my databases, as it’s quick and easy to setup, and I don’t have to enable Internet access to the MySQL server (directly anyways). I use it in both development & production, which brings up an interesting problem. I often have multiple PMA tabs open at one time, and sometimes get development/production mixed up and make changes I shouldn’t. Normally I’m pretty careful about this, but sometimes your co-worker goes in and drops all of your databases by mistake…. Tip #1, keep good backups. Luckily I had that tip down pat. Tip #2, don’t give co-workers drop privileges on your database if they don’t need it. Lesson learned.  🙂

Both of these tips are great advice, but they don’t address the issue of mixing up your tabs. Thankfully, I found a solution.

phpmyadmin-warningThis banner shows up on every page within phpMyAdmin, and I didn’t even have to hack any core files to do it! In your main phpMyAdmin directory, create a file called and put the following in it to achieve the same effect:

#floating_menubar {
top: 41px!important;
<div style="height:40px;"></div>
<h1 style="position:fixed;top:0;left:0;width:100%;z-index:510000;background:#ffc0cb;margin:0;color:#000;line-height:40px;padding:0 10px;border-bottom: 1px solid #800000;font-weight:normal;">
Warning! You Are In Production. Proceed With Caution.

Hopefully this will help to avoid the same mishap in the future!



2 Replies to “phpMyAdmin woes”

  1. Thanks for that post. I am one and know several of those idiots that Matthew recognises so clearly.

    I had been looking to find out where the header file should be located. After playing with the html for a bit, I was not happy with how to remainder of the page flows after the header.

    I have since copied a theme and replaced the file logo-left.png with one that identifies the database. Just three steps required:
    1. Copy an existing theme
    2. Drop a new image called logo-left.png into the img folder for the new theme
    3. Edit in the theme root to change the theme_name

  2. What kind of idiot drops a database full of tables 🙂

Leave a Reply