Upgrading MySQL, PHP MySQL Client Version, phpMyAdmin

Some mental notes for myself in case I encounter this again, and maybe this will help someone as I was doing Google searches trying to figure this out myself…

I have a server with ServInt, which runs WebHost Manager (WHM) and cPanel.  I logged into phpMyAdmin and it said I was running MySQL 4 instead of 5.  Wanting to upgrade to MySQL 5, I went into WHM and used cPanel->Upgrade to Latest Version and Software->Update Server Software.  This updated everything just fine and it said I was running MySQL 5 (and doing “SELECT VERSION()” returned 5), even though phpMyAdmin still did not report v5.

I assumed the fact that I was running a very old version of phpMyAdmin was the problem.  Since I couldn’t find anyway to automatically upgrade phpMyAdmin in WHM/cPanel, I did the following, which tries to use your existing phpMyAdmin config file:

# wget -O /usr/local/cpanel/base/3rdparty/phpMyAdmin-3.1.2-all-languages.tar.gz http://dfn.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-3.1.2-all-languages.tar.gz
# tar xzf /usr/local/cpanel/base/3rdparty/phpMyAdmin-3.1.2-all-languages.tar.gz -C /usr/local/cpanel/base/3rdparty/
# cd /usr/local/cpanel/base/3rdparty/
# rm -f phpMyAdmin-3.1.2-all-languages.tar.gz
# cp -R phpMyAdmin phpMyAdmin-backup
# cp phpMyAdmin/config.inc.php phpMyAdmin-3.1.2-all-languages/config.inc.php
# mv phpMyAdmin phpMyAdmin-old
# mv phpMyAdmin-3.1.2-all-languages phpMyAdmin

And then I got an error in phpMyAdmin, and seeing nothing significant in my old config file, did this to use the sample that comes with the new version:

# rm phpMyAdmin/config.inc.php
# cp phpMyAdmin/config.sample.inc.php phpMyAdmin/config.inc.php

Then phpMyAdmin worked just fine, and the new version differentiates between Server version (which was now correct) and PHP Client version (which didn’t sound right).  I checked phpinfo() and the PHP MySQL client version was 5, but I read that I would have to recompile PHP.  I took the opportunity to upgrade from Apache 1 to 2 and to the latest release of PHP 5, all done using EasyApache under WHM->Softare.

With PHP upgraded and recompiled, I then went ahead and launched phpMyAdmin again.  It still gives the warning, “Your PHP MySQL library version 4.1.22 differs from your MySQL server version 5.0.67. This may cause unpredictable behavior.”, which is what I was trying to get rid of, but now I give up.  I know my MySQL client and server versions are both 5, so if anyone knows how to fix that warning let me know.

Let me know if you know why phpMyAdmin gives this warning.

PS, I also did this:

#vi phpMyAdmin/config.inc.php

and added a random string under blowfish_secret.

Follow @philfreo on Twitter

Want to know when I write another post? (very infrequent)

3 Comments

  1. Bryan Scott said,

    January 31, 2009 @ 2:23 pm

    Call Servint. That’s what I did when I needed to upgrade to MySQL 5.0. They have a dedicated NOC for situations like this.

    The way I look at it, a direct phone line to a NOC is part of what you pay for with Servint.

  2. Phil Freo said,

    February 1, 2009 @ 9:18 pm

    Yeah, I’ve asked them for similar stuff before. Upgrading to MySQL 5 was very simple (one or two clicks through WHM). It was just phpMyAdmin that was tougher.

  3. Harishankar said,

    March 17, 2009 @ 9:52 pm

    This is the same problem I’ve got. Exactly the same.

RSS feed for comments on this post