This is a well respected plugin for PHP and MySQL users everywhere.
I do sometimes use Webmin
, but fellow contributor Nick Fratangelo reckons phpMyAdmin is the dog's bollocks, especially for certain MySQL configurations which he did explain to me but I've forgotten already.
Google and download phpMyAdmin-2.6.3-pl1.tar.gz
[2.63M] (or its updated equivalent) to the /usr/local/src
directory or get later versions from Sourceforge.net
tar -zxvf phpMyAdmin-2.6.3-pl1.tar.gz
Within there is a file called Documentation.txt
which outlines the installation procedure. Funny how it starts with telling you to tar -zxvf phpMyAdmin-2.6.3-pl1.tar.gz, because you wouldn't be able to see the document unless you'd already untarred it. Ho hum..
Prerequisites include PHP 4.1.0 or newer and MySQL 3.23.32 or newer, so you might like to take a look at the LAMP Server
which shows how to get these fine services working first. Interestingly it doesn't explicitly list Apache as a prerequisite, but you'll be needing that too.
Basically phpMyAdmin just sits inside the Apache tree, where you can access its default index.php
file and configure stuff from there. There are a couple of configs to modify however.
Firstly extract the .tar.gz to /usr/local/apache/htdocs
or wherever Apache is installed. Rename (mv
) the default /phpMyAdmin-2.6.3-pl1
directory name to something more convenient, like pma
. If you're really clever you could do it all in one bold command..
mv phpMyAdmin-2.6.3-pl1 /usr/local/apache/htdocs/pma
The instructions suggest to next open the file config.inc.php
in a text editor and change the values for host
and authentication mode
to fit your environment. Here, "host" means the MySQL server. Have a look at Configuration
section for an explanation of all values.
Here are the two values I change:
a] Find the first instance of the string
$cfg['Servers'][$i]['host'] = ' ';
..and insert the computername of the server inside the single quotes at the end..
$cfg['Servers'][$i]['host'] = 'vampyre';
b] Find the first instance of the string
$cfg['PmaAbsoluteUri'] = ' ';
..and insert the absolute URL path to the phpMyAdmin directory, as you would connect from another computer. I find that http://<ip address><path>
works quite nicely..
$cfg['PmaAbsoluteUri'] = 'http://192.168.0.111/pma';
This should be all you have to
do as far as installation and configuration go, however you will quite rightly get warnings about the lack of security. Personally I like to get phpMyAdmin working first and then password protect it afterwards; that way it's easier to diagnose any problems which might occur.
There are three main authentication methods - config, cookie and http; I prefer to use the latter. This authentication method requires a knowledge of password protecting Apache
a] Edit config.inc.php
..and (just below the above settings) find the first instance of the string ..
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user
from the single quotes..
$cfg['Servers'][$i]['user'] = ''; // MySQL user
b] Finally, drop an .htaccess
file into the /pma
directory. An attempted connection from another computer should now be prompted for a username and password before allowing access to phpMyAdmin.