phpMyAdmin on Fedora

Note: a much more sophisticated tool is MySQL Workbench.

phpMyAdmin is a handy web based tool that provides a quick interface to all mysql databases running on a given system.

On Fedora, it is available via yum (as of 6/14/2011 under Fedora 15, you would get version 3.4.1). After installing the package there are two places that immediately should get your attention:

/etc/httpd/conf.d/phpMyAdmin.conf

This file sets up the apache alias for /phpmyadmin, causing it to reference /usr/share/phpMyAdmin. It also sets up whatever restrictions you may want to (and ought to) have on this directory. As shipped, the fedora script allows access to localhost via an "allow from 127.0.0.1" statement. I also had to add a specific "allow from" statement for the IP number of my machine before it would work.

I also password protect this directory via the following statements in the /usr/share/phpMyAdmin directory section.:

   AuthUserFile /xxx/yyy/passwords
   AuthName myuser
   AuthType Basic
   <Limit GET>
      require valid-user
   </Limit>

/etc/phpMyAdmin/config.inc.php

This is a big file of PHP code that sets a myriad of options to configure phpMyAdmin.of PHP code that sets a myriad of options to configure phpMyAdmin. The bulk of it sets values in the $cfg array of hashes, and there are detailed tutorials available about how to fuss with this.

In particular though, you will need to set the PHP user and password by fiddling with the following values:

$cfg['Servers'][$i]['auth_type']     = 'config';
$cfg['Servers'][$i]['user']          = 'billy';
$cfg['Servers'][$i]['password']      = 'thekid';

Some security notes

I see many attempts in my apache logs where people are trying to fetch /phpMyAdmin/scripts/setup.php from many different paths. We can only hope these attempts are failing.
Have any comments? Questions? Drop me a line!

Adventures in Computing / [email protected]