Web www.freebsdmadeeasy.com
Main Menu

Other Sites





Using phpMyAdmin to manage a MySQL server

phpMyAdmin is an extremely useful tool for managing a MySQL, it allow you to perform queries, create new tables, add databases, backup existing ones, and much more.

Installing phpMyAdmin

phpMyAdmin can be installed from the ports with the following commands

# cd /usr/ports/databases/phpmyadmin
# make install

Configuring phpMyAdmin

phpMyAdmin will install to /usr/local/www/phpMyAdmin by default. To access it you can either set up the alias as the install tells you, or you can create a virtual host for it so you can access it from a domain such as phpmyadmin.yourdomain.com. If you have it accessible to the outside world you need to password protect the directory so that others do not have full access to your database. These can be done by adding the following to your httpd.conf

<VirtualHost *:80>
DocumentRoot /usr/local/www/phpMyAdmin
ServerName phpmyadmin.yourdomain.com
CustomLog /usr/local/www/logs/phpmyadmin-access_log combined
ErrorLog /usr/local/www/logs/phpmyadmin-error_log
</VirtualHost>

<Directory "/usr/local/www/phpMyAdmin">
Options Indexes FollowSymLinks
AllowOverride AuthConfig
Order deny,allow
Allow from all
</Directory>

Before opening it in your web browser you will need to edit the phpMyAdmin config file and give it the details of your MySQL server.

# cp /usr/local/www/phpMyAdmin/config.default.php /usr/local/www/phpMyAdmin/config.inc.php

The config file is located at /usr/local/www/phpMyAdmin/config.inc.php To get on your server you must change the following lines if you have changed your root password on your MySQL server.

$cfg['Servers'][$i]['user']	= 'root';
$cfg['Servers'][$i]['password']	= 'your_pass';

Now you are ready to point your web browser at your phpMyAdmin URL and begin managing your server.


Comments

Submitted by FryShadow on May 4, 2008
The new one from FreeBSD 7 , when i install phpmyadmin it says that need the blowfish_secret under config.inc.php
 
 maybe this can help :)
 
 cheers
Submitted by Shane Hale on Dec 14, 2008
One thing I figured out - Im a total noob BTW - is that you need to ad an Alais for the /phpMyAdmin directory in httpd.conf if you are not going to use the virtual host scenario given in this tutorial. It would look like this if you are using the default directory created by the phpMyAdmin ports based install:
 
 Alias /phpMyAdmin /usr/local/www/phpMyAdmin
 
 May be worth adding this option into the tutorial for folks not planning to do the sub-domain approach.
 
 Thank you though once again for this tremendous effort.... I was lost without the information I found here.
 
 Shane Hale
Submitted by >.> on Feb 8, 2009
I had the problem that the correct version of PDFlib-lite was missing. Solved it by downloading the correct version here: https://www2-pcmdi.llnl.gov/trac/browser/cdat/trunk/exsrc/src/PDFlib-Lite-7.0.2.tar.gz?rev=6295 and moving it to the /usr/ports/distfiles
Ask a question or add a comment here.