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,
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:
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:
# Apache 2.4
Require ip 127.0.0.1
Require ip ::1
Require all granted
Now Restart Apache:
$ systemctl restart httpd