How to setup phpMyAdmin on Centos 7?

This tutorial explains how to setup phpMyAdmin on your CentOS 7 system.

 

Prerequisites
  • Additional EPEL or IUS repositories should be installed on your system.
  • PHPMySQL and Apache2 should be installed on your system.
 
Summary
  1. Install phpMyAdmin
  2. Configure phpMyAdmin
  3. Restart Apache2

1. Install phpMyAdmin

First, you will need to install phpMyAdmin on your system.

Command: sudo yum install phpmyadmin

2. Configure phpMyAdmin

Now you need to configure phpMyAdmin to be able to connect to the web interface.

Command: sudo nano /etc/httpd/conf.d/phpMyAdmin.conf

Output:

<Directory /usr/share/phpMyAdmin/>
 <IfModule mod_authz_core.c>
  # Apache 2.4
  <RequireAny>
    Require all granted
    Require ip 127.0.0.1
    Require ip ::1
  </RequireAny>
 </IfModule>
 <IfModule !mod_authz_core.c>
  # Apache 2.2
  Order Deny,Allow
  Deny from All
  Allow from 127.0.0.1
  Allow from ::1
 </IfModule>
</Directory>

Add the following line in the configuration file as shown in the output above.

Require all granted

Or add an IP address in RequireAny to allow connection from a specific IP address.

Require ip 192.168.0.1

3. Restart Apache2

3.1. Finally, you need to restart Apache2 for changes to take effect.

Command: sudo systemctl restart httpd.service

3.2. Now you can access the phpMyAdmin web interface, in your web browser.

URL: http://domain_name_or_IP/phpMyAdmin

or

URL: http://domain_name_or_IP/phpmyadmin

Note: Use your MySQL (MariaDB) user login details to log into your phpMyAdmin.

 

Leave a Reply

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