How toLinuxLinuxUncategorized

How to Install phpMyAdmin on a CentOS 7

PhpMyAdmin is open source software for managing MySQL and MariaDB through a browser.

If you have MariaDB server installed or MySQL on your CentOS 7 Linux server, the only way to manage the database is through the Command Line Interface (CLI) or any software tools for managing a database like “MySQL Workbench”, DataGrip, dbeaver.

PhpMyAdmin provides an interactive GUI environment that you can use to create databases, tables and even running queries right from a browser Window.

In this guide, we will focus on the main steps to install phpMyAdmin on your CentOS 7 server.

Step 1: First update your system:

To ensure that we have updated system software and dependencies, we need to run the command below:

$ yum update

Type Y and hit Enter when prompted to install the updates.

This will ensure that our Centos 7 server has the latest security and general package updates.

Step 2: Check the status of MySQL or MariaDB is Running

$ systemctl status mysqld
$ systemctl status mariadb

If you don’t have the database server on your server or system,
You can run the command below to install MariaDB server or MySql server

$ yum install mysql-server


$ yum install MariaDB-server galera MariaDB-client MariaDB-shared MariaDB-backup MariaDB-common

To start MySql or MariaDB server, you need to run the commands below:

$ systemctl start mysqld


$ systemctl start mariadb

To ensure that our MariaDB server will start at boot, we need to run the command below:

$ systemctl enable mariadb


$ systemctl enable mysqld

Since a default MariaDB server installation is not secure, we can run the command below to secure it:

$ mysql_secure_installation

Step 3: Install phpMyAdmin

After verified that MySQL/MariaDB server is up and running, Now you can Install phpMyAdmin using the commands below:

$ yum install phpMyAdmin

Type Y and Enter to confirm the installation

Next, we need to edit the phpMyAdmin configuration file using a vi editor:

$ vi /etc/httpd/conf.d/phpMyAdmin.conf

Now need to add “Require All granted” value just under the ‘/usr/share/phpMyAdmin/’directory

So, the final file excerpt should look like the one below:


<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
# Apache 2.4
Require ip
Require ip ::1
Require all granted

Now Restart Apache:

$ systemctl restart httpd

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

7Zs6 8Zb jZ

Please type the text above: