Quick Tip: How to Install phpMyAdmin

Assuming you already have mysql server installed on your machine, the reason you are
installing phpmyadmin is to ease  your administration of  your MySQL like database creation and deletion, create/alter/drop/view tables and execute any SQL statements, privilege and trigger management, stored procedures, and backup/ maintenance

phyMyAdmin is a tool built in PHP to manage and administer your MySQL servers via your browser.


5. Apache

1. Install the necessary requirements
[root@freelinuxtutorials src]# yum install php-mysql
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.primusdatacentre.com.au
* updates: mirror.primusdatacentre.com.au
* addons: mirror.primusdatacentre.com.au
* extras: mirror.primusdatacentre.com.au
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
–> Running transaction check
—> Package php-mysql.i386 0:5.1.6-23.2.el5_3 set to be updated
–> Processing Dependency: php-pdo for package: php-mysql
–> Running transaction check
—> Package php-pdo.i386 0:5.1.6-23.2.el5_3 set to be updated
–> Finished Dependency Resolution

Dependencies Resolved

Package           Arch         Version                   Repository       Size
php-mysql         i386         5.1.6-23.2.el5_3          updates          85 k
Installing for dependencies:
php-pdo           i386         5.1.6-23.2.el5_3          updates          64 k

Transaction Summary
Install      2 Package(s)
Update       0 Package(s)
Remove       0 Package(s)

Total download size: 148 k
Is this ok [y/N]: y

2. Download and uncompress the distro kit from phpmyadmin.net download page

3.If you have PHP 5.2+ version. phpmyadmin version 3X is advised. You can download it in

[root@freelinuxtutorials src]#cd /usr/local/src
[root@freelinuxtutorials src]#wget

[root@freelinuxtutorials src]# bunzip2 phpMyAdmin-3.2.2-all-languages.tar.bz2
[root@freelinuxtutorials src]# tar xvf phpMyAdmin-3.2.2-all-languages.tar

*for PHP 5.2 below,
[root@freelinuxtutorials src]#cd /usr/local/src
[root@freelinuxtutorials src]#wget

[root@freelinuxtutorials src]#tar zxvf phpMyAdmin-

4. Move and rename the extracted folder to your web server’s document root usually in


[root@freelinuxtutorials src]# mv phpMyAdmin- phpmyadmin
[root@freelinuxtutorials src]#cp -R phpmyadmin /var/www/html

5. Configure phpmyadmin

There are two ways to configure:

A. Manual Configuration

-Create a file called config.inc.php on sthe phpmyadmin main directory or you can copy the


[root@freelinuxtutorials src]#cp config.sample.inc.php config.inc.php

– Edit blowfish secret

// use any value here for blowfish_secret, max of 46 chars.
$cfg[‘blowfish_secret’] = ‘adf3fad107d65002’; /* YOU MUST FILL IN THIS FOR COOKI
E AUTH! */

// auth type can be “cookie” or “http”, you can put cookie in it esp. for testing and to

see some error messages if any
$cfg[‘Servers’][$i][‘auth_type’] = ‘cookie’;

/* Select mysqli if your server has it */
$cfg[‘Servers’][$i][‘extension’] = ‘mysql’;

//If you want password for “root”

To manually create the file, simply use your text editor to create the file config.inc.php

(you can copy config.sample.inc.php to get minimal configuration file) in the main

(top-level) phpMyAdmin directory (the one that contains index.php). phpMyAdmin first loads

libraries/config.default.php and then overrides those values with anything found in

config.inc.php. If the default value is okay for a particular setting, there is no need to

include it in config.inc.php. You’ll need a few directives to get going, a simple

configuration may look like this:

$cfg[‘blowfish_secret’] = ‘ba17c1ec07d65003’;  // use here a value of your choice

$cfg[‘Servers’][$i][‘auth_type’]     = ‘cookie’;

B. Via Setup Script

– Create a folder “config” in the phpmyadmin directory and set permissions

[root@freelinuxtutorials src]#cd /var/www/html/phpmyadmin
[root@freelinuxtutorials src]#mkdir config
[root@freelinuxtutorials src]#chmod o+rw config

– Edit config.inc.php
[root@freelinuxtutorials src]#cp config.inc.sample.php config.inc.php
[root@freelinuxtutorials src]#cp config.inc.php config/
[root@freelinuxtutorials src]#chmod o+w config/config.inc.php

– Now open setup thru your favorite browser, open http://machineIPaddress/phpmyadmin/setup

– Save changes under the configuration area.

– Once finished saving, move file to phpmyadmin directory and revert back the permission

for security purposes

[root@freelinuxtutorials src]#mv config/config.inc.php .
[root@freelinuxtutorials src]#chmod o-rw config.inc.php

6. Access now the phpmyadmin and use your mysql access to login

Note: You can setup an .htaccess in that folder for added security


About the author


View all posts

Leave a Reply