How to Install phpMyAdmin on CentOS 8

Install phpMyAdmin on CentOS 8

In this article, we will have explained the necessary steps to install and configure phpMyAdmin on CentOS 8. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

phpMyAdmin is an open source, web based administration tool for managing the MySQL or MariaDB database. It is written in PHP and is one of the most popular database administration tools used by web hosting companies to enable novice system administrators to carry out database activities.

Install phpMyAdmin on CentOS

Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.

Step 2. Install LAMP stack on Ubuntu.

It is assumed that you have already installed LAMP stack on CentOS system. If not, please check out the following tutorial.

Step 3. Install phpMyAdmin.

First, we are going to install phpMyAdmin by downloading the source tarball from phpMyAdmin downloads page:

Move the phpMyAdmin set up to your desired location:

Step 4. Configure phpMyAdmin.

Now, we copy the sample configuration file:

Then, edit the configuration file and add a blowfish secret:

Next, import the create_tables.sql to create new tables for phpMyAdmin:

Step 5. Configure Apache web Server.

Now, we create an alias in the Apache web server so that phpMyAdmin can be accessed with http://your-ip-add-dress/phpmyadmin:

Add the below content to the above file:

Create a tmp directory for phpMyAdmin and change the permission:

Also, set the ownership of phpMyAdmin:

Then, restart Apache service:

Step 6. Configure SELinux  and Firewall.

Create SELinux policies for phpMyAdmin:

Next, create a firewall rule to allow HTTP requests:

Step 7. Accessing phpMyAdmin.

You can now access your phpMyAdmin from the browser by navigating to browser and using the the address, http://your-ip-add-dress/phpmyadmin:

Install phpMyAdmin on CentOS 8

That’s all you need to do to install phpMyAdmin on CentOS 8. I hope you find this quick tip helpful. If you have questions or suggestions, feel free to leave a comment below.