Steps to Install phpMyAdmin on CentOS 7 0

phpMyAdmin is a popular web-based tool for managing MySQL or MariaDB databases. It provides an intuitive interface for database management tasks, including creating, editing, and deleting databases, tables, or entries. This guide will walk you through the steps to install phpMyAdmin on a CentOS 7 server.


Prerequisites

Before starting, ensure you have the following:

  1. A CentOS 7 server with root or sudo access.

  2. A LAMP stack (Linux, Apache, MySQL/MariaDB, PHP) installed and configured.

  3. Basic familiarity with using the terminal.


Step-by-Step Installation

Step 1: Update the System

Ensure your system is up-to-date:

sudo yum update -y




Step 2: Install the EPEL Repository

phpMyAdmin is not included in the default CentOS repositories. You need to install the EPEL (Extra Packages for Enterprise Linux) repository:

sudo yum install epel-release -y




Step 3: Install phpMyAdmin

Once the EPEL repository is enabled, install phpMyAdmin using the following command:

sudo yum install phpmyadmin -y




Step 4: Configure phpMyAdmin

After installation, you need to configure phpMyAdmin to allow access.


  1. Open the phpMyAdmin configuration file in a text editor:

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



  1. Locate the following lines in the file and modify them to allow access from your IP address. Replace YOUR_IP_ADDRESS with your actual IP address:

Require ip YOUR_IP_ADDRESS


Example:

Require ip 192.168.1.100


Alternatively, you can allow access to all by replacing:

Require local


With:

Require all granted



  1. Save the changes and exit the editor.


Step 5: Restart Apache

To apply the changes, restart the Apache web server:

sudo systemctl restart httpd




Step 6: Access phpMyAdmin

  1. Open your web browser and navigate to:

http://SERVER_IP/phpmyadmin


Replace SERVER_IP with your server's IP address.


  1. Log in using your MySQL/MariaDB username and password.


Step 7: Secure phpMyAdmin (Optional but Recommended)

To enhance security:


  1. Restrict access by creating an additional layer of authentication:

sudo htpasswd -c /etc/phpmyadmin/.htpasswd admin


You will be prompted to set a password.


  1. Edit the phpMyAdmin configuration file again:

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


  1. Add the following lines:

    AuthType Basic

    AuthName "Restricted Access"

    AuthUserFile /etc/phpmyadmin/.htpasswd

    Require valid-user


  1. Restart Apache:

sudo systemctl restart httpd


Troubleshooting

  • Error 403 Forbidden: Ensure your IP address is correctly configured in the phpMyAdmin configuration file.


  • phpMyAdmin Not Loading: Check Apache and PHP logs for errors:

sudo tail -f /var/log/httpd/error_log




Conclusion

You have successfully installed and configured phpMyAdmin on your CentOS 7 server. With this setup, you can now manage your databases efficiently via a web interface. Always remember to secure your phpMyAdmin installation to protect your data.


Was this answer helpful? #0 #0
 

Did We Miss Out on Something?

Relax, we have you covered. At Go4hosting, we go the extra mile to keep our customers satisfied. We are always looking out for opportunities to offer our customers “extra” with every service. Contact our technical helpdesk and we’d be more than happy to assist you with your Cloud hosting, Colocation Server, VPS hosting, dedicated Server or reseller hosting setup. Get in touch with us and we’d cover all your hosting needs, however bizarre they might be.

Related Questions

Submit your Query

  • I'm not a robot

Browse by ServicesBrowse by Services

Resource Library

What is Cloud Computing

Understand the term cloud computing, the ongoing trend, its playing field, future growth and how industry...

Myths about Cloud Computing

Cloud computing, in the recent years, has become a subject of significant discussion among the industry experts.

Download Now

Did We Miss Out on Something?

Relax, we have you covered. At Go4hosting, we go the extra mile to keep our customers satisfied. We are always looking out for opportunities to offer our customers “extra” with every service. Contact our technical helpdesk and we’d be more than happy to assist you with your Cloud hosting, Colocation Server, VPS hosting, dedicated Server or reseller hosting setup. Get in touch with us and we’d cover all your hosting needs, however bizarre they might be.

Submit Query

Please fill in the form below and we will contact you within 24 hours.