How-to Install phpMyAdmin on CentOS 6

In my previous blog post, I showed you how-to install LAMP on CentOS 6 and in this tutorial I’m going to show you how-to install phpMyAdmin on CentOS 6.If you don’t know what phpMyAdmin is, let me tell you. phpMyAdmin is free software written in PHP, intended to handle the administration of MySQL over the Internet.

Add Fedora EPEL Repositories

Since phpMyAdmin is not included in the CentOS default repositories, we need to get it from the Fedora Projects EPEL (Extra Packages for Enterprise Linux) repositories.

sudo yum install epel-release



If you get the following error:

wget : command not found

You can install wget, like so:

sudo yum install wget

Next, we will download package:

sudo rpm -ivh epel-release*

If you want to check to see if EPEL has been added, type and enter:

yum repolist

You should see EPEL listed; something like:

epel              Extra Packages for Enterprise Linux 6 - x86_64

We can now remove the repository package, since it’s been added to the server:

rm epel-release*

Install phpMyAdmin

We can now install phpMyAdmin:

sudo yum install phpmyadmin

Configure phpMyAdmin

We will now secure phpMyAdmin so only your personal computer’s IP address is recognized and can use phpMyAdmin.

To find your IP address, go to Google and ask Google “what is my IP”. Google search will show you, your IP address.

You can also use, which is a free service.

Once you’ve figured out what your IP address is, run:

cd /etc/httpd/conf.d/

Now, we will change all occurrences of with your IP address.

sed -i 's/' phpMyAdmin.conf

Replace newip with your personal computer’s IP address.

You can do this manually, by opening phpMyAdmin.conf and changing to your IP address. Look for occurrences of:

Require ip


Allow from

You can now restart Apache like sudo service httpd restart or start it if it hasn’t been started sudo service httpd start.

Access phpMyAdmin

You can access phpMyAdmin by going to http://<IP Address>/phpmyadmin or http://hostname/phpmyadmin.

Where <IP Address> is your VPS’s IP address or where hostname is your VPS’s hostname.

The username is root and the password is your MySQL’s password.

You’re done!