How to Install phpMyAdmin on CentOS 7

How to Install phpMyAdmin on CentOS 7

install phpmyadmin centos 7This tutorial explains the process of installing one of the most popular open-source applications for managing MySQL databases – phpMyAdmin. phpMyAdmin is a free and open source web-based application written in PHP, used to easily manage MySQL databases through your favorite web browser instead of the MySQL command line interface. phpMyAdmin allows users to create, modify, rename and delete databases, tables or fields, execute SQL commands through the browser, import and export tables to a wide range of formats, create users and modify their privileges, and much more… We are going to install phpMyAdmin on a CentOS 7 VPS with Apache, MariaDB, and PHP

phpMyAdmin has a long list of handy features such as:

  • Intuitive and easy to use a web interface
  • Support for almost all MySQL operations
  • Import data from CSV and SQL
  • Export data to different formats such as CSV, SQL, XML, PDF, ISO/IEC 26300 – OpenDocument Text and Spreadsheet, Word, LATEX, and others
  • Easily administer multiple MySQL servers from a single phpMyAdmin installation
  • Creating graphics of your database layout in various formats
  • Creating complex queries using Query-by-example (QBE)
  • Searching globally in a database or a subset of it
  • Transforming stored data into any format using a set of predefined functions, like displaying BLOB-data as image or download-link
  • And many more…

1. Requirements

In order to run phpMyAdmin on your CentOS 7 VPS you need the following requirements preinstalled
– Web server: Apache, Nginx or IIS
– PHP version 5.3.0 or newer, with session support, the Standard PHP Library (SPL) extension, JSON support, and mbstring, zip and GD2 extension.
– MySQL or MariaDB database server version 5.5 or newer
– CentOS 7 VPS with root access enabled

2. Login via SSH

Login to your CentOS 7 VPS via ssh as user root

ssh roo@IP_Address -p Port_number

3. Update all packages

Once you are logged in to the server run the following command to make sure that all installed packages are up to date

yum -y update

4. Install LAMP stack

As mention in the requirements section of the tutorial, a LAMP stack (Apache, MySQL/MariaDB and PHP) is required to run phpMyAdmin no the server. We will start with installing Apache web server

yum -y install httpd

After the installation is completed, start the web server and enable it to start upon server boot

systemctl enable httpd

Next, install PHP along with the required PHP extensions

yum -y install php php-common php-mbstring php-gd

And finally, complete the LAMP installation by installing MariaDB database server

yum -y install mariadb mariadb-server

Start the service and set it to start on reboot

systemctl start mariadb
systemctl enable mariadb

Run the ‘mysql_secure_installation’ post-installation script provided by MariaDB to strengthen the security of the database server and set a root password. You can use the following options:

Set root password? [Y/n] Y
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

5. Install phpMyAdmin

phpMyAdmin is not available in the official CentOS 7 repositories, so we will have to enable the EPEL repository by executing the following command

yum -y install epel-release

Once the EPEL repository is enabled we can proceed with the phpMyAdmin installation

Need a fast and easy fix?
✔ Unlimited Managed Support
✔ Supports Your Software
✔ 2 CPU Cores
✔ 2 GB RAM
✔ 50 GB PCIe4 NVMe Disk
✔ 1854 GeekBench Score
✔ Unmetered Data Transfer

Now just $43 .99

yum -y install phpmyadmin

The package manager will install phpMyAdmin and all necessary dependencies and the installation of phpMyAdmin is completed. You can now access the application and start working on your databases at http://IP_Address/phpmyadmin .

Installing phpMyAdmin on CentOS 7

By default, phpMyAdmin is only accessible from the localhost. If you want it to be accessible from everywhere or a certain IP address, open its included Apache configuration file and add/edit the following lines accordingly:

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

     # Apache 2.4
      Require ip IP_Address
      Require ip
      Require ip ::1
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from IP_Address
     Allow from
     Allow from ::1

Where IP_Address is the actual IP address.

6. Restart Apache web server

Save the changes and restart the Apache web server for the changes to take effect.

systemctl restart httpd

For more information on how to configure and use phpMyAdmin please check their official documentation at

install phpmyadmin on CentOS 7Of course, you don’t have to install phpMyAdmin on your CentOS 7 VPS, if you use one of our Managed Hosting Services, in which case you can simply ask our expert Linux admins to install phpMyAdmin for you. They are available 24×7 and will take care of your request immediately. For more updates, you can also read our guide on How to Install phpMyAdmin on CentOS 8.

PS. If you liked this post, on how to install phpMyAdmin on Ubuntu 16.04, please share it with your friends on the social networks using the buttons below or simply leave a comment in the comments section. Thanks.

3 thoughts on “How to Install phpMyAdmin on CentOS 7”

  1. I was constantly searching for how to install phpMyadmin properly to my CentOS machine and tried different method, but your method worked perfectly and let me login to myphpadmin with an instant.

    Thank you!


Leave a Comment