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/phpmyadmin
# make install clean

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

Before we continue rainloop will add some apache modules so we should restart apache:

# /usr/local/etc/rc.d/apache24 restart

Now you must configure your installation.

# cd /usr/local/www/phpMyAdmin
# cp

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

# vi /usr/local/etc/apache24/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/phpMyAdmin"

</Directory "/usr/local/www/phpMyAdmin">
Options None
AllowOverride None
Require all granted

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 get is a forbidden message.

You can also Add security to your setup as seen below:

Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"

Options none
AllowOverride Limit
Order Deny,Allow

# Deny from all
Require ip
##Additional lines you can add as needed for more IP addresses
Allow from