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:
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:
We can now install phpMyAdmin:
sudo yum install 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 whatismyip.com, which is a free service.
Once you’ve figured out what your IP address is, run:
Now, we will change all occurrences of 127.0.0.1 with your IP address.
sed -i 's/127.0.0.1/newip/g' phpMyAdmin.conf
newip with your personal computer’s IP address.
You can do this manually, by opening
phpMyAdmin.conf and changing 127.0.0.1 to your IP address. Look for occurrences of:
Require ip 127.0.0.1
Allow from 127.0.0.1
You can now restart Apache like
sudo service httpd restart or start it if it hasn’t been started
sudo service httpd start.
You can access phpMyAdmin by going to
http://<IP Address>/phpmyadmin or
<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.