How to setup phpMyAdmin on Centos 7?

How to setup phpMyAdmin on Centos 7?

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


  • Additional EPEL or IUS repositories should be installed on your system.
  • PHPMySQL and Apache2 should be installed on your system.
  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


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

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

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


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.