Thursday, February 23, 2012 - 04:50
FeedBurner  RSS 2.0 Feed  Follow Me On Twitter  Save On Delicious

Installing phpMyAdmin

Guide on how to install phpMyAdmin on FreeBSD

Phpmyadmin is a web interface for administrating MySQL. Now this is for the people out there who don’t have the time or interest in learning how to administrate MySQL by command line arguments.

Installing phpMyAdmin on FreeBSD is really quite simple and easy. This guide will help you install phpMyAdmin from ports.

As root
cd /usr/ports/databases/phpmyadmin
make install clean

Accept the default values and hit ok [Screenshot] If “Improved MySQL Support is checked uncheck it”

Before you continue I recommend creating a superuser other than root to be used in conjunction with phpMyadmin and MySQL. To do this follow the next step. If you rather would like to use root which I strongly advise against you can simply skip the next step.

replace “user” and “password” with the real user and password you would like to use.

As root
mysql -u root -p
connect mysql
GRANT ALL PRIVILEGES ON *.* TO user@localhost IDENTIFIED BY 'password' WITH GRANT OPTION;
exit

Now we need to edit the configuration file for phpMyAdmin

As root
cd /usr/local/www/phpMyAdmin
cp config.sample.inc.php config.inc.php
vi config.inc.php

Find this line
$cfg['blowfish_secret'] = ' '; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

Add a password between the two ' ' so it will look like below

Change “password” with a MySQL superuser password
$cfg['blowfish_secret'] = 'password'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

Find this line
// $cfg['Servers'][$i]['controluser'] = 'pma';

Remove the two // and change “pma” to the username you want to use when you log on to the web interface.

How the line should look
$cfg['Servers'][$i]['controluser'] = 'username';

Find this line
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';

Remove the two // and change “pmapass” to the password you want to use when you log on to the web interface.

How the line should look
$cfg['Servers'][$i]['controlpass'] = 'password';

We need to modify apache’s httpd.conf file so we can access phpMyAdmin from http://www.yoursite.com/phpmyadmin

Find this line
NameVirtualHost *:80

And add the following lines below it. “IP-Number” is the IP numbers you want to allow access to the web interface separated by “space”. Now this is strongly recommended as a security enhancement.

Add the following
Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"

<Directory "/usr/local/www/phpMyAdmin/">
Options none
AllowOverride Limit
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 IP-Number IP-Number IP-Number
</Directory>

As root
apachectl restart
Related Guides  Links  Requirements