In this guide, you will learn, how to install phpMyAdmin on CentOS 7 or other Redhat based Linux distros. #centlinux #linux #mysql
Table of Contents
What is phpMyAdmin?
phpMyAdmin is a free and open-source MySQL web interface. phpMyAdmin is developed in PHP and distributed under GNU GPL 2 license. phpMyAdmin is a portable web application and due to this reason, it become one of the most popular MySQL administration tools, especially for web hosting services.
Database administrators and developers uses phpMyAdmin to perform various tasks such as creating, modifying or deleting databases, tables, fields or rows; executing SQL statements; managing users and permissions; or monitoring database instances.
In this guide, we will install phpMyAdmin on CentOS 7 based LAMP server.

phpMyAdmin System Requirements
According to phpMyAdmin documentation following software are required by phpMyAdmin.
- Database – MySQL / MariaDB 5.5 or later
- Web Server – Apache, Nginx, IIS, etc.
- PHP – PHP 7.1.3 or later
Environment Specification
In this article, we are using the same CentOS 7 LAMP server, that we have configured in our previous post Install LAMP Stack on CentOS 7.
- Hostname – phpmyadmin-01.example.com
- IP Address – 192.168.116.191 / 24
- Operating System – CentOS 7.6
Recommended Training: The Ultimate MySQL Bootcamp: Go from SQL Beginner to Expert from Colt Steele

Install MariaDB on CentOS 7
Connect with phpmyadmin-01.example.com server using ssh as root user.
Required version of MariaDB 5.5 is available in CentOS 7 standard yum repositories. Therefore, we are installing it using yum command.
yum install -y mariadb-server.x86_64
Start and enable MariaDB service.
systemctl enable --now mariadb.service
Configure and secure MariaDB service as follows.
mysql_secure_installation
Output:
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] Y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] Y
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] Y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] Y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
MariaDB database has been installed on our Linux server. The password of root user, that we have set here will be used later to login on phpMyAdmin web interface.
Anker Prime TB5 Docking Station, 14 Ports Thunderbolt 5 Docking Station with 140W Max Charging, 120Gbps Max Transfer, Ambient LED Lighting, Cooling System, Up to 8K Display for Thunderbolt 5/4 Laptops
$399.99 (as of May 27, 2025 17:24 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Install Apache on CentOS 7
Apache HTTP server is also available in CentOS 7 official yum repositories. Therefore, we are installing Apache web server using yum command.
yum install -y httpd.x86_64
Start and enable httpd.service.
systemctl enable --now httpd.service
Allow HTTP service in Linux firewall.
firewall-cmd --permanent --add-service=http
firewall-cmd --reload
Apache HTTP server is installed on our Linux server.
Install PHP on CentOS 7
phpMyAdmin requires PHP 7.1.3 or later that is not available in CentOS 7 official yum repositories. Therefore, we have to install a third party yum repository for installing our required version of PHP.
We will use Remi yum repository to install PHP 7.1.3. But first, we have to install EPEL (Extra Packages for Enterprise Linux) because it is required by Remi yum repository.
yum install -y epel-release.noarch
Install Remi yum repository as follows.
rpm -ivh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
Output:
Retrieving http://rpms.remirepo.net/enterprise/remi-release-7.rpm
warning: /var/tmp/rpm-tmp.wO9bgO: Header V4 DSA/SHA1 Signature, key ID 00f97f56: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:remi-release-7.6-2.el7.remi ################################# [100%]
Build cache for new yum repositories.
yum makecache fast
Output:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 5.8 kB 00:00
* base: ftp3.isra.edu.pk
* epel: mirror.xeonbd.com
* extras: ftp3.isra.edu.pk
* remi-safe: rpms.remirepo.net
* updates: ftp3.isra.edu.pk
base | 3.6 kB 00:00
epel | 5.3 kB 00:00
extras | 3.4 kB 00:00
remi-safe | 3.0 kB 00:00
updates | 3.4 kB 00:00
(1/4): epel/x86_64/group_gz | 88 kB 00:00
(2/4): remi-safe/primary_db | 1.6 MB 00:03
(3/4): epel/x86_64/primary_db | 6.8 MB 00:15
(4/4): epel/x86_64/updateinfo | 997 kB 00:35
Metadata Cache Created
Install PHP 7.2 and relevant packages.
yum install -y php72-php php72-php-mysqlnd php72-php-gd php72-php-xml php72-php-mbstring
PHP 7.2 and relevant packages has been installed on our Linux server.
We have successfully configured a CentOS 7 based LAMP server.
Aula WIN60 HE – 60% Mechanical Gaming Keyboard Wired, Magnetic Switch Hot Swappable, Adjustable Actuation Rapid Trigger Mode, 8000 Hz Polling Rate, RGB Small Keyboard 60 Percent Compact Design for PC
20% OffInstall phpMyAdmin on CentOS 7
phpMyAdmin 4.4 is available in EPEL yum repository. However, phpMyAdmin 5 has been released and available for download on their website.
If you want to use some exclusive features of phpMyAdmin 5 then you have to install it. Otherwise, phpMyAdmin 4.4 will serve the purpose of database administration as well.
Install phpMyAdmin on CentOS 7 using yum command.
yum install -y phpmyadmin
phpMyAdmin created it’s configuration in Apache HTTP server at /etc/httpd/conf.d/phpMyAdmin.conf.
By using Apache Access Control, phpMyAdmin only allows access by localhost in its default configurations.
Therefore, we need to edit it to allow access by other network systems.
vi /etc/httpd/conf.d/phpMyAdmin.conf
In following directive, Add a configuration below as highlighted in yellow color.
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 127.0.0.1
Require ip ::1
Require ip 192.168.116
</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>
Restart httpd.service to apply changes.
systemctl restart httpd.service
Access phpMyAdmin Web UI
Browse URL http://phpmyadmin-01.example.com/phpmyadmin in client’s browser.

Login using MariaDB database credentials. We are login as root user here.

We are now at the phpMyAdmin dashboard.
The only databases are visible here on which user has permissions.
Since, root is the super-user of MariaDB server, therefore, it can see all databases on the server.
Python Distilled
$37.67 (as of May 28, 2025 17:31 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Conclusion
Installing phpMyAdmin on CentOS 7 gives you a convenient, web-based interface to manage your MySQL or MariaDB databases more efficiently. In this guide, we covered installing the required packages, configuring Apache, securing phpMyAdmin access, and verifying the setup.
With phpMyAdmin successfully installed, you now have a powerful tool to handle database operations like creating tables, running queries, and performing backups — all through an easy-to-use graphical interface. Remember to keep phpMyAdmin updated and properly secured to protect your database server from unauthorized access.
Searching for a skilled Linux admin? From server management to security, I ensure seamless operations for your Linux systems. Find out more on my Fiverr profile!
Leave a Reply
You must be logged in to post a comment.