Christopher Brewer: How To
Installation Instructions
How do I install PHPMyAdmin on a Linux server?

1. Install the mcrypt package to speed up phpMyAdmin functions.

2. Make sure mySQL packages is installed (preferably 4.1.2 or better), although mySQL 5 isn't recommended as of 9/38/05 as it is still relatively new.

3. Make certain mysqld and Apache httpd is set to autostart at bootup.

4. Download and install phpMyAdmin to /var/www/[installdir]. Download the gzip distribution, move it to /var/www/ then untar it:
  # mv phpMyAdmin_x.x.x.tar.gz /var/www/
  # tar -xzvf phpMyAdmin_x.x.x.tar.gz

5. Create a static link from /var/www/html/phpmyadmin to /var/www/[installdir]:
  # cd /var/www/html
  # ln -s /var/www/[installdir] ./phpmyadmin

6. Change ownership of all files to apache:
  # chown -R apache. /var/www/[installdir]
  # chown apache. /var/www/html/phpmyadmin

7. Load the instructions from http://localhost/phpmyadmin/Documentation.html in your browser.

8. Edit /var/www/[installdir]/config.inc.php per above instructions, adding all the pma tables, as well as using cookies for the auth method. See the attached config.inc.php.html sample file. DO NOT JUST COPY THIS SAMPLE OVER as configuration files can (and do) change.

9. Set the password for the root user in mysql by issuing:
  # mysql -u root
  mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpwd');
  mysql> SET PASSWORD FOR 'root'@'host_name' = PASSWORD('newpwd');

  In both statements, replace 'newpwd' with the password of your choice. In the second SET PASSWORD statement, replace host_name with the name of the server host.

10. Load the SQL at /var/www/[installdir]/create_tables_mysql_4_1_2+.sql into the mySQL command line client:
  # mysql -u root -p
  mysql> SOURCE /var/www/[installdir]/scripts/create_tables_mysql_4_1_2+.sql

11. Execute the following query in the mySQL command line client. Make sure you change 'pmapass' in the sql below to mirror what you entered in the $cfg['Servers'][$i]['controlpass'] line of config.inc.php:
  # mysql -u root -p
  mysql> GRANT USAGE ON mysql.* TO 'pma'@'localhost' IDENTIFIED BY 'pmapass';          GRANT SELECT (            Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv,            Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv,            File_priv, Grant_priv, References_priv, Index_priv, Alter_priv,            Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv,            Execute_priv, Repl_slave_priv, Repl_client_priv            ) ON mysql.user TO 'pma'@'localhost';          GRANT SELECT ON mysql.db TO 'pma'@'localhost';          GRANT SELECT ON mysql.host TO 'pma'@'localhost';          GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv)            ON mysql.tables_priv TO 'pma'@'localhost';

12. Using your browser, log in to http://localhost/phpmyadmin/ to test.


Attachment: config.inc.php ( 40.5kb )
W3C HTML 4.01