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

or

$ 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

Or

$ systemctl start mariadb

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

$ systemctl enable mariadb

Or

$ 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
<RequireAny>
Require ip 127.0.0.1
Require ip ::1
Require all granted
</RequireAny>
</IfModule>
</Directory>
...

Now Restart Apache:

$ systemctl restart httpd

Related Articles

Leave a Reply

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

dXjf0

Please type the text above:

Check Also

Close
Close
Close