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 config.sample.inc.php config.inc.php
# vi config.inc.php
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:
Deny from all
And add the following:
Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin211/"
Deny from all
Allow from 127.0.0.1 .example.com
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:
GRANT ALL PRIVILEGES ON *.* TO mysqluser@localhost IDENTIFIED BY 'password' WITH GRANT OPTION;
This is the same user/pass combination that you created in the config.inc.php page.
Now if you go to http://yoursite.com/phpmyadmin 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.