How to Install phpMyAdmin on CentOS 6.2 using EPEL Repository

Share this Article :

phpmyadmin

PhpMyAdmin

phpMyAdmin is a free software tool written in PHP intended to handle the administration of MySQL over the World Wide Web. It can manage a whole MySQL server (needs a super-user) as well as a single database. phpMyAdmin supports a wide range of operations with MySQL. The most frequently used operations are supported by the user interface (managing databases, tables, fields, relations, indexes, users, permissions, etc), while you still have the ability to directly execute any SQL statement. In this post, i will show on how to install phpMyAdmin on CentOS 6.2 using EPEL repository. This post assumed that MySQL and Apache Httpd server has been installed and configured as per documented guidelines below :
How to Install Httpd on CentOS 6.2
How to Install MySQL Database Server on CentOS 6.2
How to Secure MySQL Database Server

1. How to Install and Configure EPEL Repository :
Follow this steps to install and configure the Extra Packages for Enterprise Linux (EPEL) repository on CentOS 6.2. EPEL repository is another extra repository that creates, maintains, and manages a high quality set of additional packages for Enterprise Linux, including, but not limited to, Red Hat Enterprise Linux (RHEL) and CentOS server.

2. Simply run yum command to install phpmyadmin :

[[email protected] ~]# yum install phpmyadmin -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.hostemo.com
 * epel: ftp.riken.jp
 * extras: mirrors.hostemo.com
 * updates: ossm.utm.my
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package phpMyAdmin.noarch 0:3.4.9-1.el6 will be installed
--> Processing Dependency: php-gd >= 5.2.0 for package: phpMyAdmin-3.4.9-1.el6.noarch
--> Processing Dependency: php-php-gettext for package: phpMyAdmin-3.4.9-1.el6.noarch
--> Running transaction check
---> Package php-gd.i686 0:5.3.3-3.el6_2.6 will be installed
---> Package php-php-gettext.noarch 0:1.0.11-3.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                    Arch              Version                      Repository          Size
====================================================================================================
Installing:
 phpMyAdmin                 noarch            3.4.9-1.el6                  epel               4.1 M
Installing for dependencies:
 php-gd                     i686              5.3.3-3.el6_2.6              updates            102 k
 php-php-gettext            noarch            1.0.11-3.el6                 epel                21 k

Transaction Summary
====================================================================================================
Install       3 Package(s)

Total download size: 4.2 M
Installed size: 15 M
Downloading Packages:
(1/3): php-gd-5.3.3-3.el6_2.6.i686.rpm                                       | 102 kB     00:00
(2/3): php-php-gettext-1.0.11-3.el6.noarch.rpm                               |  21 kB     00:00
(3/3): phpMyAdmin-3.4.9-1.el6.noarch.rpm                                     | 4.1 MB     00:46
----------------------------------------------------------------------------------------------------
Total                                                                89 kB/s | 4.2 MB     00:48
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : php-php-gettext-1.0.11-3.el6.noarch                                              1/3
  Installing : php-gd-5.3.3-3.el6_2.6.i686                                                      2/3
  Installing : phpMyAdmin-3.4.9-1.el6.noarch                                                    3/3

Installed:
  phpMyAdmin.noarch 0:3.4.9-1.el6

Dependency Installed:
  php-gd.i686 0:5.3.3-3.el6_2.6                php-php-gettext.noarch 0:1.0.11-3.el6

Complete!

3. Open the phpMyAdmin.conf configuration file as below :

[[email protected] ~]# vi /etc/httpd/conf.d/phpMyAdmin.conf

Original phpMyAdmin.conf configuration file :

<Directory /usr/share/phpMyAdmin/>
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1
</Directory>

Change as below. Default setting only allows only localhost. Changes below will allow access to any ip address but very dangerous unless properly secured by SSL :

<Directory /usr/share/phpMyAdmin/>
Order Deny,Allow
Deny from All
Allow from All
Allow from ::1
</Directory>

4. Restart apache httpd service to take effect :

[[email protected] ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

5. Open PhpMyAdmin from myour browser using the following URL :

http://ipaddress/phpmyadmin/

Leave a Reply