Introduction
phpMyAdmin is a widely used open-source tool developed in PHP for managing MySQL and MariaDB databases through a web browser. Its graphical interface simplifies database management compared to using the command line.
This tutorial will walk you through the steps to install phpMyAdmin on CentOS 7.
Prerequisites
Before proceeding with the phpMyAdmin installation, ensure the following software is installed on your server:
- Apache Web Server: If it's not installed, refer to our Apache installation guide.
- MySQL: Check out our guide on Installing MySQL on CentOS 7.
- PHP: Installation instructions for PHP can be found here.
Installation Guide
Step 1: Install EPEL Repository
- First, add the EPEL repository by executing:
yum install epel-release
- The EPEL repository includes extra packages like phpMyAdmin. With it added, you can proceed with installing phpMyAdmin.
Step 2: Install phpMyAdmin
- Run the following command to install phpMyAdmin:
yum install phpmyadmin
Step 3: Configure phpMyAdmin Access
To enable remote access to phpMyAdmin, you need to edit its configuration file, allowing connections from specified IP addresses.
Open the phpMyAdmin configuration file by running:
vi /etc/httpd/conf.d/phpMyAdmin.conf
Require ip 127.0.0.1
Allow from 127.0.0.1
- Modify these lines to include your workstation's IP address, replacing "your_ip" with the actual IP address:
Require ip your_ip
Allow from your_ip
- Save the changes and exit the editor (press "Esc", then type
:wq
and press "Enter").
Step 4: Restart Apache
- After updating the configuration file, restart Apache to apply the changes:
systemctl restart httpd
Step 5: Verify phpMyAdmin Access
- To access phpMyAdmin, open your web browser and navigate to:
http://server_ip/phpmyadmin
If everything is configured correctly, the phpMyAdmin login page will appear, where you can enter your MySQL user credentials:
You can now manage your databases using phpMyAdmin.
Note: If you cannot access the phpMyAdmin page, double-check the configuration file for any errors or missed modifications. Ensure all required lines have been correctly updated.