Install PHPMyAdmin on CentOS (Apache)

If you are running CentOS on your server and want to install PHPMyAdmin, this tutorial is for you.

PREREQUISITES

You should have installed MySQL on your server.

Apart from this, we need to install the EPEL for Centos Repositories. Use this command to get the repositories:

rpm -ivh http://epel.mirror.net.in/epel/7/x86_64/e/epel-release-7-1.noarch.rpm

After this, update the repositories with this command:

yum check-update

With this done, we are now ready to install PHPMyAdmin

Steps

i) Install PHPMyAdmin. Use the command below

sudo yum install phpmyadmin

ii) Configure PHP with Apache

Open the conf file located at /etc/httpd/conf.d/phpMyAdmin.conf

Edit the file with a Text editor such as Notepad and edit the following lines:

Require IP 127.0.0.0

Allow From 127.0.0.0

To

Require IP [insert your IP]

Allow from [insert your IP]

Note: You can find out your IP at this website: https://whatismyip.net

The IP you are supposed to insert the above lines are your internet IP, not your VPS IP.

Also, there are two instances of Require IP 127.0.0.0 and Allow From 127.0.0.0 on the file. Make sure you replace the default 127.0.0.0 in both instances with your Internet IP (IP of the computer that you will be using the access PHPMyAdmin)

iii) Save the file

iv) Restart Apache service using this command

sudo service httpd restart

And with that, PHPMyAdmin will have been installed on your server.

Accessing PHPMyAdmin

To access your PHPMyAdmin, simply go to http://[enter your VPS server IP/phpmyadmin e.g.

if you server IP is 189.890.0.8, you will go to http://189.890.0.8/phpmyadmin

To log into the PHPMyAdmin, use your root username and password.

If you are using another OS apart from CentOS, you can enter root for the username and leave the password blank.

If you have forgotten your mysql username and password, use the command below to reset it

$ mysqladmin -u root password NEWPASSWORD

Note: replace NEWPASSWORD with your intended password.

That’s it, folks. If you have any questions, let me know in the comments below.

You can also buy me some coffee if I solved your issue:

Written By
I Cozens
More from I Cozens

16 Days to my Birthday

Saturday, July 1st, 2015 It's 16 days to my 29th birthday and...
Read More

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.