How do I install phpMyAdmin to handle the administration of MySQL database server over the World Wide Web under Fedora / Scientific / CentOS / RHEL / Red Hat Enterprise Linux 6.x server systems?
phpMyAdmin is a tool written in PHP intended to handle the administration of MySQL over the World Wide Web. Most frequently used operations are supported by the user interface (managing databases, tables, fields, relations, indexes, users, permissions, while you still have the ability to directly execute any SQL statement. It comes with an intuitive web interface, support for most MySQL features.
Step #1: Turn on EPEL repo
phpMyAdmin is not included in default RHEL / CentOS repo. So turn on EPEL repo as described here:
$ cd /tmp
$ wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
# rpm -ivh epel-release-6-5.noarch.rpm
Step #2: Install phpMyAdmin
Type the following command:
# yum search phpmyadmin
# yum -y install phpmyadmin
Sample outputs:
Loaded plugins: rhnplugin Setting up Install Process Resolving Dependencies There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them. --> Running transaction check ---> Package phpMyAdmin.noarch 0:3.5.1-1.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================================== Package Arch Version Repository Size ================================================================================================== Installing: phpMyAdmin noarch 3.5.1-1.el6 epel 4.2 M Transaction Summary ================================================================================================== Install 1 Package(s) Total download size: 4.2 M Installed size: 17 M Downloading Packages: phpMyAdmin-3.5.1-1.el6.noarch.rpm | 4.2 MB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : phpMyAdmin-3.5.1-1.el6.noarch 1/1 Verifying : phpMyAdmin-3.5.1-1.el6.noarch 1/1 Installed: phpMyAdmin.noarch 0:3.5.1-1.el6
Step #3: Configure phpMyAdmin
You need to edit /etc/httpd/conf.d/phpMyAdmin.conf, enter:
# vi /etc/httpd/conf.d/phpMyAdmin.conf
It allows only localhost by default. You can setup HTTPD SSL as described here (mod_ssl) and allow LAN / WAN users or DBA user to manage the database over www. Find line that read follows
Require ip 127.0.0.1
Replace with your workstation IP address:
Require ip 10.1.3.53
Again find the following line:
Allow from 127.0.0.1
Replace as follows:
Allow from 10.1.3.53
Save and close the file. Restart Apache / httpd server:
# service httpd restart
Open a web browser and type the following url:
https://your-server-ip/phpMyAdmin/
OR
http://your-server-ip/phpMyAdmin/
Sample outputs:
Please note that you will be prompted for a username and password. You need to provide your database username and password to login into the user interface. If you want to manage all database use mysql admin user account called root. phpMyAdmin configuration file is located at /etc/phpMyAdmin/config.inc.php. You can edit this file using a text editor:
# vi /etc/phpMyAdmin/config.inc.php
All directives are explained in Documentation.html and on phpMyAdmin wiki.
Check out related media
This tutorial is also available in video format:
(Video.01: Installing phpMyAdmin Demo)
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop










![RHEL / CentOS Yum Command: Blacklist Packages [ Disable Certain Packages ]](http://s0.cyberciti.org/images/rp/1/24.jpg)



{ 8 comments… read them below or add one }
MySQL Workbench, SQLyog, or HeidiSQL are all better tools and come without the bloat and security holes.
Or you could spend a few minutes and learn to manage MySQL via CLI and not have the boatload of security risks that phpMyAdmin brings.
I don’t get why everyone just “luvs” phpmyadmin, and yet still they wonder why/how their servers get compromised.
If someone needs phpmyadmin add another alias interface (ip address) and put in a rule to only allow this through a gateway and/or ip-range.
For some end users at an ISP they want this and using an ipchain you can lock it down, additional security.
rename phpmyadmin folder = mydbconf, dbmysite, xdbxconfx, etc
move phpmyadmin to different subdomain = xdbxconfx.mydomain.com
configure on different port = xdbxconfx.mydomain.com:5169
force SSL, no root, configure limit and burst on port :5169 in iptables.
Nice Article…
thank you
I followed these instructions and had no problems – very good step by step description.
Just a couple of thoughts:
Re: instructions are fine except now version is epel-release-6-8 and should be used instead of the version numbers in the first part of the instructions…it is useful just to check this out before starting…i.e. what is the version number now?
Re: vonskippy – If using a headless Linux based MySQL installation (as part of a LAMP stack) with either no or only limited direct connection to the server then myPHPAdmin still works well, (it doesn’t need any sort of GUI support at the server end).. although should be restricted/security hardened as mentioned in the other posts…HeidiSQL works but really is simplest to use on a MSWindows box, SQLyog is lovely but not free (good in serious production enviroments; but for development?) and the MySQLWorkbench depends on a GUI –
However I also agree having some familiarity with the CLI is good idea….
the 3rd step is not working on my end. Its not showing the ip adresses whenever im enterng these codes vi /etc/httpd/conf.d/phpMyAdmin.conf
its showing BLANK. Please help me. Thanks!
well done bro !
hi from Venice