Blue Flower

phpMyAdmin handles the administration of MySQL over the Web. It can manage a whole MySQL server as well as a single database. For more information please see

To install phpmyadmin, run the following commands

# cd /usr/ports/databases/phpmyadmin211
# make install clean

Leave everything checked other than Improved MySQL support and tab down to OK.

Now you must configure your installation.

# cd /usr/local/www/phpMyAdmin211/
# cp
# vi

Edit the following lines:

$cfg['blowfish_secret'] = 'Password'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
$cfg['Servers'][$i]['controluser'] = 'mysqluser';
$cfg['Servers'][$i]['controlpass'] = 'password';

The last two lines above will be commented and you need to uncomment them. the mysqluser and password are the ones you will want to specify to login to phpmyadmin.

Now to edit the /usr/local/etc/apache22/httpd.conf file:

# vi /usr/local/etc/apache22/httpd.conf

Scroll down where you see the first <Directory> statement:

<Directory />
AllowOverride None
Order deny,allow
Deny from all

And add the following:

Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin211/"

<Directory "/usr/local/www/phpMyAdmin211/">
Options none
AllowOverride Limit

Order Deny,Allow
Deny from all
Allow from

Exit and then restart Apache:

# apachectl restart

Now to add a user with "superuser" options for mysql, heres how to do it:

# mysql -u root -p

When you get to the mysql> prompt type:


This is the same user/pass combination that you created in the page.

Now if you go to you should get a phpmyadmin page. Use the username and password you set above to login.

If you get a forbidden page, You will want to check the Allow from line in the Directory statement above and make sure it lists the network you are coming from. If not, All you will gte is a forbidden message.