PhpMyAdmin installation

phpMyAdmin is a nifty GUI tool for administering MySQL installations. Don't confuse it with phpPgAdmin (for postgres), they're very different (the latter is nicer to use, and is made by different people).


It doesn't need to be installed, just downloaded and extracted somewhere convenient. You can drop it in /var/www/html and Alias to it, or the user can just keep it in their public_html. Some distros (eg. Debian) have packaged versions available, but this isn't necessary. You don't really need it managed, and you can apply updates yourself; a non-packaged version is more flexible.

  1. Grab a tarball from

  2. You can probably go with the latest stable English version. Version 3 requires minimum versions of PHP 5.2 and MySQL 5.0.15, so check that first.

    # This will obviously vary depending on your system. For the record, RHEL5 doesn't meet the PHP requirement.
    $ php -v
    PHP 4.3.9 (cgi) (built: Jul 15 2008 10:14:59)
    $ /usr/libexec/mysqld --version
    /usr/libexec/mysqld  Ver 4.1.22 for redhat-linux-gnu on i386 (Source distribution)
  3. Unpack the tarball to /var/www/html/

  4. Create a symlink to the unpacked tarball. This make future upgrades really easy.

    ln -s phpMyAdmin- phpmyadmin


Upgrading is almost the same as installing.

  1. Download and unpack the tarball
  2. Remove the old symlink

    rm phpmyadmin
  3. Create the new symlink

    ln -s phpMyAdmin- phpmyadmin
  4. Configure it as detailed below
  5. Any existing login cookies will now be invalidated; the user will need to login again


phpMyAdmin needs almost no configuration, it's easy!

  1. cd into phpmyadmin (the symlink)

  2. Create a config file from the sample

  3. Edit
    • Set the blowfish_secret to a non-empty value. Try not to do anything stupid like having quotemarks or backslashes in there.

      $cfg['blowfish_secret'] = 'thisIsAVerySecureStringJustMashTheKeyboardABitsjkefhkscejrnhsueh'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
      • I did a fresh install of on a server and PHP was dying with fatal errors, "mcrypt_encrypt(): Size of key is too large for this algorithm in /.../mcrypt.lib.php". WTF? Shortening the 'blowfish_secret' string fixed this.

    • Check that auth_type is cookie

  4. Edit the relevant apache vhost config and add an Alias entry for the installation

            # phpMyAdmin
            Alias /phpMyAdmin /var/www/html/phpmyadmin
  5. Reload Apache and test it