phpMyAdmin updating tool

l0rdphi1

Verified User
Joined
Jun 22, 2003
Messages
1,471
This is an unofficial tool, but seems as though it is related enough to belong here.

Anyway, though daunting when attempted manually, updating your phpMyAdmin install through this tool is very easy.

Simply run the following code to get going:
Code:
wget [url]http://www.l0rdphi1.com/tools/update.phpmyadmin.sh[/url]
sh update.phpmyadmin.sh
Note that this is confirmed working with phpMyAdmin 2.5.5-pl1 and earlier versions, but the tool should work with any version. Let me know if you run into any problems.

Also, as a bonus :D , IF your are running the current version of DA and would like to move your phpMyAdmin directory from /var/www/html/phpMyAdmin-X.Y.Z to a more covenant directory (/var/www/html/phpMyAdmin), run the following code:
Code:
rename /var/www/html/phpMyAdmin-?.?.? /var/www/html/phpMyAdmin /var/www/html/phpMyAdmin-?.?.?
perl -pi -e 's#phpMyAdmin-.\..\..#phpMyAdmin#g' /etc/httpd/conf/httpd.conf
service httpd restart
Cheers, Phi1.
 
Last edited:
With the number of phpMyAdmin releases their team makes, this is quite possibly the most valuable tool on the forum.

Thanks for sharing :)!
 
Just wanted to say - this works perfectly! Thank you so much. Anything to make life just a little easier...

JOhn
 
i just tried this, appears to be working great...does it grab files from the official phpadmin site or something?
 
vandal said:
i just tried this, appears to be working great...does it grab files from the official phpadmin site or something?
Yes, it grabs the files off sf.net.

Thanks for the positive feedback everyone :)
 
mmm, I ran it, and now it doesnt ask for login info, just says access denied for root@localhost
 
You did a fresh install, not an upgrade (I assume!)

When it asks where your phpmyadmin is installed, specify the exact path:

/var/www/html/phpMyAdmin-X.X.X

as default it is set to:

/var/www/html

If you want to simply fix that problem:

open up the config.php in /var/www/html/phpmyadmin (or wherever PMA is located)

and edit:

$cfg['Servers'][$i]['auth_type']

It *should* be http, however a fresh install (non upgrade) chnages this to config, which then causes that error.

Chris
 
I got this message this time :

rename: renaming /var/www/html/phpMyAdmin to /var/www/html/phpMyAdmin-backup failed: Directory not empty
mkdir: cannot create directory `/var/www/html/phpMyAdmin': File exists
 
What directory do you have phpMyAdmin installed in? Did you enter that directory properly? Were you loged in on the root user? Hmm.
 
The dir and user were good and the upgrade did work.

The only problem is that there already was a backup folder ;)

So maybe you could enhance your script to detect that and provide a choice of options?
 
where the current rename is this should be ok:

Code:
if [ $MODE = 1 ]
then
        BACKUP_DIR="$INSTALL_DIRECTORY-backup"

#############
# Check backup directory does not exist, if it does, offer an option to use another backup directory
#############

        if [ -d $BACKUP_DIR ]
        then
                echo -e "The backup location; $BACKUP_dir already exists. Please specify a new location for your phpMyAdmin $
                echo -e "\nNew Backup Location:"
                read BACKUPLOC
                mv $INSTALL_DIRECTORY $BACKUPLOC
        else
                BACKUPLOC="$BACKUP_DIR"
                mv $INSTALL_DIRECTORY $BACKUPLOC

fi
fi

Code:
# if upgrading...
if [ $MODE = 1 ]
then
        # restore old config.inc.php
        rm -f ${INSTALL_DIRECTORY}/config.inc.php
        cp -f $BACKUPLOC/config.inc.php ${INSTALL_DIRECTORY}

        echo ""
        echo "Upgraded!"
        echo ""

        echo "Now, check and make sure phpMyAdmin is working."
        echo "Hit 'y' to remove old version backups ($BACKUPLOC)."
        echo "Hit 'n' to leave the backups."
        echo "(y/n) [y]"
        read bool_rmback

        case "$bool_rmback" in
                [nN])   ;;
                *)      echo "Removing backups..."
                         rm -fr $BACKUPLOC
                        ;;
        esac

fi

Was already in shell writing a latest DA script so thought i'd just write it to excuse all my delays here lately :rolleyes: :D

Chris

Edit: the last bit needs to be modified also...

Now, check and make sure phpMyAdmin is working.
Hit 'y' to remove old version backups (/var/www/html/phpMyAdmin-backup).
Hit 'n' to leave the backups.
(y/n) [y]

Edit2: Edit 1 fixed :p
 
Okay, I've updated the script with that and a few other small fixes.

Cheers, Phi1. :)
 
Found the error...i made a typo in the config.inc.php :)
 
Last edited:
Installed ok but have this when I log in to phpmyadmin:

The $cfg['PmaAbsoluteUri'] directive MUST be set in your configuration file!

That directive is blank in the config file but it says to test by editing a row and saving, which I did without warnings or issues. Now theoretically I can set the

$cfg['PmaAbsoluteUri_DisableWarning'] = FALSE;

to TRUE which will kill that error warning.

Thoughts?
 
Back
Top