Go to content Go to navigation Go to search

phpMyAdmin

July 29th, 2010 by jde

FreeBSD 8.1
MySQL 5.1
phpMyAdmin 3.3

phpMyAdmin is a nice webbased gui to administer MySQL databases. It is for developers and system adminstrators who has in-depth knowledge of database systems – it is NOT for ordinary users.

Installation:

# cd /usr/ports/databases/phpmyadmin
# make install clean
Options for phpMyAdmin 3.3.4
[ ] SUPHP    suPHP support
[X] BZ2      bzip2 library support
[X] GD       GD library support
[X] MYSQLI   Improved MySQL support
[X] OPENSSL  OpenSSL support
[X] PDF      PDFlib support (implies GD)
[X] ZLIB     ZLIB support
[X] MCRYPT   MCrypt library support
[X] ZIP      Zip compression support

Configuration

After installation you need to configure Apache. First you must decide how you want to access phpMyAdmin:

  1. http://www.existing-site.com/pma
  2. http://pma.existing-site.com

If #1 is your choice, the only thing you need to do is adding an alias within the VirtualHost of existing-site.com

<VirtualHost *:80>
  DocumentRoot /usr/local/www/existing-site.com
  ServerName www.existing-site.com
  ServerAlias existing-site.com
  Alias /pma/ "/usr/local/www/phpMyAdmin/"
  Alias /pma "/usr/local/www/phpMyAdmin"
  (etc, etc...)
</VirtualHost>

If #2 is your choice, you’ll need to add  a new VirtualHost:

<VirtualHost *:80>
  DocumentRoot /usr/local/www/phpMyAdmin
  ServerName pma.existing-site.com
  (etc, etc...)
</VirtualHost>
 

After that, restart Apache and you’re basically done…

Every user in the mysql database now has access through phpMyAdmin. Therefore it is a good idea to tell phpMyAdmin who isn’t allowed.
Also phpMyAdmin will complain, if ‘blowfish_secret’ is not set. So this is my configuration:

$cfg['blowfish_secret'] = 'ollah';

$i = 0;

$i++;
$cfg['Servers'][$i]['AllowDeny']['order'] = 'deny,allow';
$cfg['Servers'][$i]['AllowDeny']['rules'] = array(
'deny postfix from all',
'deny squirrelmail from all',
'deny spamassassin from all'
);

Every configuration option available is documented at the PmaWiki

Leave a Reply