phpMyAdmin Setup Guide
Table of ContentsOverview
Upgrading a previous installation
Additional phpMyAdmin documentation
Installing other versions of phpMyAdmin
phpMyAdmin is an application written in the PHP language that provides a web-based interface for the administration of MySQL databases.
A version of phpMyAdmin has been customized for use on Webserve. Information on how to install it and use it to connect to the MySQL service is documented below.
Upgrading a previous installationIf you previously installed the phpMyAdmin application using the install_phpmyadmin command on Webserve, you may upgrade to the latest version (3.3.3) by following the instructions found in phpMyAdmin Upgrade Process.
Important Notice: The application must be installed within the wwws directory.
Follow the steps below to install the phpMyAdmin program into your account on Webserve:
- Login to your Webserve account using an SSH command line client such as PuTTY. For further instructions on this step, see: How to use PuTTY.
- Move into your wwws directory by typing:
webserve:account> cd wwws
If your account does not have a 'wwws' directory, refer to the Secure WWW Server document for information on creating this necessary directory.
- Install phpMyAdmin by typing the following:
An .htaccess file similar to the one below is automatically created in the phpmyadmin directory.
AuthUserFile IUauth AuthGroupFile /dev/null AuthType Basic AuthName "IU Network ID" <Limit GET POST> require user account </Limit>
You should not delete this .htaccess file. Removing it will make your MySQL database vulnerable to exploit.
This .htaccess file currently restricts access to the IU Network ID 'account' where 'account' is the name of your Webserve account. You can edit this .htaccess file to add additional users to the line (separate each name with a space):
<Limit GET POST> require user account username1 username2 </Limit>
You will need to edit the config.inc.php file before running phpMyAdmin. To move into the directory where this file is located, type: cd phpmyadmin
As you edit the file, make sure lines do not wrap as a result of your edits. If you notice the line wraps as you enter information, correct the line so that it does not wrap.
Below is the section of the config.inc.php file that you need to edit in order to establish a database connection. Replace port number, username, and password as shown below with the port number for your account and the username/password that you've granted privileges to when setting up your database.
$cfg['Servers'][$i]['host'] = 'mysql.iu.edu'; // MySQL hostname $cfg['Servers'][$i]['port'] = 'port number'; // MySQL port $cfg['Servers'][$i]['extension'] = 'mysql'; $cfg['Servers'][$i]['connect_type']= 'tcp'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['auth_type'] = 'config'; $cfg['Servers'][$i]['user'] = 'username'; // MySQL user $cfg['Servers'][$i]['password'] = 'password'; // MySQL password
By default, the config.inc.php file has three blocks: one for connecting to the MySQL production server (mysql.iu.edu), one for connecting to the test MySQL server (mysql-test.iu.edu) and a blank one. The test server and blank ones are commented out so if you wish to establish connections beyond the first block, you will need to remove the "//" as these serve to "comment out" that portion of the file. Below is an example of the block with the comment tags still present.
//$cfg['Servers'][$i]['host'] = 'mysql-test.iu.edu';//MySQL hostname //$cfg['Servers'][$i]['port'] = ''; // MySQL port //$cfg['Servers'][$i]['extension'] = 'mysql'; //$cfg['Servers'][$i]['connect_type']= 'tcp'; //$cfg['Servers'][$i]['compress'] = FALSE; //$cfg['Servers'][$i]['auth_type'] = 'config'; //$cfg['Servers'][$i]['user'] = ''; // MySQL user //$cfg['Servers'][$i]['password'] = ''; // MySQL password
Note: Completing the installation steps above will create a directory named 'phpMyAdmin-3.3.3-all-languages' and a symbolic link named 'phpmyadmin' that points to this directory. This symbolic link will make it possible for you to access the application by specifying 'phpmyadmin' in the URL rather than 'phpMyAdmin-3.3.3-all-languages'. The permissions for 'phpmyadmin' is set to world read/write/execute. This is appropriate since this is a symbolic link. Your phpMyAdmin-3.3.3-all-languages directory, however, has proper permissions set and should not be altered.
Make sure that you have made the necessary edits to the '.htaccess' and 'config.inc.php' files before trying to access the application. In the example below, the 'phpMyAdmin' directory was created within the 'wwws' directory using the 'install_phpmyadmin' command above.
- You may access the phpMyAdmin interface by using any of the following (replace "account" with the name of your web account):
Additional phpMyAdmin documentation
The opening page of the phpMyAdmin program contains web links to various sources of documentation. There is also documentation available from phpMyAdmin.net .
Installing other versions of phpMyAdminIf you wish to install a different version of phpMyAdmin than the one that is made centrally available, you may do so by downloading the application into your account. If you choose this option, you must ensure the following:
- install the application within the wwws directory
- restrict access to it, such as through the use of an .htaccess file.
Information on restricting access can be found at: Controlling Web Page Access.