phpMyAdmin is a wonderful tool which allows you to use your web browser to administer your MySQL databases. It gives you a nice GUI to “create and drop databases, create/drop/alter tables, delete/edit/add fields, execute any SQL statement, manage keys on fields, manage privileges, [and] export data into various formats”.
This quick start is designed to help you get phpMyAdmin up and running lighting fast. I am currently running RedHat Linux AS3. Apache and php are already configured and running on my server. This post concentrates only on the specifics to installing phpMyAdmin 18.104.22.168.
1) Download phpMyAdmin from the download page at http://www.phpmyadmin.net/home_page/downloads.php
I downloaded the file named english.tar.bz2.
2) Unzip phpMyAdmin:
3) Extract the phpMyAdmin archive in your home directory:
tar -xvf phpMyAdmin-22.214.171.124-english.tar
4) Move the extracted directory to the document root for your website. During the move we rename it to just phpMyAdmin, removing the version number:
mv /home/tima/phpMyAdmin-126.96.36.199-english /var/www/timarcher/phpMyAdmin/
5) Change to the your new phpMyAdmin directory you just moved into the document root for your website:
6) Make a directory called config, and give it world read/write access:
mkdir config chmod 777 config
7) Now copy the template configuration file into our newly created config directory, and make it world read/writable:
cp config.sample.inc.php config/config.inc.php chmod 666 config/config.inc.php
Open up the your web browser and load the page http://mydomain.com/phpMyAdmin/scripts/setup.php On my server, the URL I opened in my web browser was:
9) Click the add button to add a server to your configuration file. This will open up a new screen of which I set these options:
Server hostname: localhost Server port:
Server socket: Connection type: tcp PHP extension to use: mysql Compress Connection: Authentication type: config User for config auth: root Password for config auth: rootMySQLpassword Only database to show: Verbose name of this server: phpMyAdmin control user: phpMyAdmin control user password: phpMyAdmin database for advanced features: Session name for signon auth: Login URL for signon auth: Logout URL:
For the “User for config auth” and “Password for config auth” parameters enter a valid MySQL username and password who has full privileges to your MySQL databases.
Once you enter the above text, click on the Add button at the bottom of the screen. I ignore the error that says ”You didn’t set phpMyAdmin database, so you can not use all phpMyAdmin features.”
10) You will then return to the phpMyAdmin Setup screen. Make sure you click on the save button.
11) Return to your unix shell prompt. Make sure you’re in the phpMyAdmin directory you initially moved to your website document root directory. On my server this directory is /var/www/timarcher/phpMyAdmin. We need to move the config file out of our world writable config directory and set its permissions appropriately:
mv config/config.inc.php ./ chmod 755 config.inc.php rmdir config
12) Open up the config.inc.php file in your favorite browser and edit the value for the parameter blowfish_secret. This line now looks like the following in my configuration file:
$cfg['blowfish_secret'] = 'putpasswordhere'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
13) You may now go back to your browser and load the page http://mydomain.com/phpMyAdmin/. On my server, the URL I opened in my web browser was:
14) You should be directed to a login page. Login with the username and password you specified for the parameters “User for config auth” and “Password for config auth” when setting up your config.inc.php file.
15) You should now be able to utilize phpMyAdmin to administer your MySQL databases. For a quick test to ensure you can run queries, press the icon/button labeled “SQL” towards the upper left hand of the page next to the “exit” button. This will open a new window in which you can enter the following SQL to just get the current date:
Upon hitting the go button, it should return to the main phpMyAdmin page showing you the results of your query. You should be able to explore from here and figure out how to manipulate your tables, look at their structures, administer your databases, etc. phpMyAdmin truly is easy to use and quick to figure out.
Congratulations, if you’ve made it this far then your basic phpMyAdmin install should now be completed. For additional information on enabling more advanced options, securing your install, etc you should read the full documentation located at http://www.phpmyadmin.net/documentation.