Search | Directories | Reference Tools
UW Home > UWIN > Computing and Networking > Web > Web Publishing > Using MySQL 

Installing phpMyAdmin

Summary

phpMyAdmin is a popular and free PHP application used for administering one or more MySQL servers. While UW Technology does not support MySQL or phpMyAdmin, this article briefly describes phpMyAdmin, outlines the steps for installing and configuring phpMyAdmin on your UW account, and provides links to additional phpMyAdmin resources.

The instructions on this page will show you how to:

Note: You must install and start your MySQL server before you can use phpMyAdmin.

About phpMyAdmin

phpMyAdmin provides an easy-to-use Web interface for most of the features of MySQL's command-line client. With phpMyAdmin you can:

Instructions

  1. Log in to your Homer or Dante account with Tera Term or another terminal emulator.

  2. Press the O key for Other, then press the W key to drop into the Web development environment and cd into your Web directory:

    cd public_html
  3. Download the latest version of phpMyAdmin with wget.

    wget http://washington.edu/computing/web/publishing/phpMyAdmin-2.11.3-english.tar.gz
  4. Unzip the file you just downloaded:

    tar -xzvf phpMyAdmin-2.11.3-english.tar.gz
  5. If this is the first time you are installing phpMyAdmin, create a symbolic link to the phpMyAdmin directory:

    ln -s phpMyAdmin-2.11.3-english phpmyadmin

    If you are upgrading an existing version of phpMyAdmin, you may wish to wait to create a symbolic link until you've verified that your new phpMyAdmin installation is working.

  6. Since phpMyAdmin is typically used with MySQL root priviliges for administration purposes, you should password-protect the phpMyAdmin directory:

    cd phpmyadmin
    pico .htaccess

    Enter the following lines to password-protect the phpMyAdmin directory with your account's UW NetID, replacing accountname with the UW NetID of your account:

    AuthType UWNetID
    require user accountname

    Press ^X to save the file and exit.

    Tip: If you're interested in learning more about controlling access to your website, see Controlling Access to Web Pages.

  7. PhpMyAdmin has a new web-based configuration interface, so we'll be using that to configure it. Let us know what you think about this if you've used the old method before.

    First create a directory for the script to write the config into:

    mkdir config

    Start a Web browser and enter the following URL, replacing depts.washington.edu/accountname with the base URL to your Web site:

    https://depts.washington.edu/accountname/phpmyadmin/scripts/setup.php

    Click on the "Add" button in the "Servers" section and fill in the following fields:

    Server hostname: ovid.u.washington.edu
    This is the host that your MySQL server is running on. If your Web site is hosted on students.washington.edu, use vergil instead of ovid.
    Server port: the port your MySQL server is configured to use
    Password for config auth: the root password for your MySQL server

    Press the button at the bottom of the "Configure Server" section that says "Add" in green. Then press the "Save" button in the "Configuration" section.

    Now copy the configuration file into the main directory and delete the config directory:

    cp config/config.inc.php ./
    rm -rf config

    Note: The phpmyadmin configuration script hasn't been working very well. Until we figure out what's going wrong with it and hopefully fix it, you should make sure that your config file actually contains the settings. Run "cat config.inc.php" and if it doesn't list setting similar to those found below, copy this sample config file and paste it into your config.inc.php file and substitute the appropriate values. Values that you need to replace are highlighted in yellow.

    <?php
    /*
     * Generated configuration file
     * Generated by: phpMyAdmin 2.9.0.2 setup script by Michal C(ihar( <michal@cihar.com>
     * Version: $Id: setup.php,v 1.36.2.3.2.1 2006/10/03 13:11:08 nijel Exp $
     * Date: Thu, 21 Jun 2007 23:21:03 GMT
     * 
     * /
    
    /* Servers configuration */
    $i = 0;
    
    /* Server ovid.u.washington.edu (config:root) [1] */
    $i++;
    $cfg['Servers'][$i]['host'] = 'ovid.u.washington.edu'; //ovid is for staff/faculty/depts/courses accounts.  
                                                           //Use vergil.u.washington.edu for student accounts.
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    $cfg['Servers'][$i]['port'] = 'your port';
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['auth_type'] = 'config';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = 'your password';
    
    /* End of servers configuration */
    
    $cfg['ForceSSL'] = true;
    $cfg['LoginCookieValidity'] = 1800;
    $cfg['GD2Available'] = 'yes';
    ?>
  8. Assuming your MySQL server is running, you are now ready to connect to it and administer it with phpMyAdmin.

    Start a Web browser and enter the following URL, replacing depts.washington.edu/accountname with the base URL to your Web site:

    https://depts.washington.edu/accountname/phpmyadmin/

Resources