For developers, the application database is important. And many projects use MySQL or MariaDB to meet this need. In this sense, an application that helps the data query and the administration of the MySQL or MariaDB instance becomes necessary. In this post, I will help you to install maybe one of the most popular ones there is, I mean PHPMyAdmin on CentOS 8
PHPMyAdmin is an open-source application created in PHP that provides the administration of a MySQL or MariaDB database from a comfortable web interface. It is simply installed on the server, we make a few small configurations and that’s it. That’s it. Without consuming many resources you will have a quality application.
So, let’s get started.
Install the latest PHPMyAdmin on CentOS 8
Despite being one of the most popular tools available for the administration of MariaDB / MySQL it is not in the CentOS 8 repositories. However, it is possible to get the latest version thanks to the REMI repository.
So, let’s go for it.
Note: All the commands will be performed as the root user. In case your user has sudo access, you can use it before executing each command.
Open a terminal and add the EPEL repository.
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
After it is added, the REMI repository must be added.
dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
Now the next step is to disable the PHP 7.2 module which is the default in the CentOS 8 installation
dnf module reset php:7.2
And now enable the PHP 7.4 module of the REMI module.
dnf module enable php:remi-7.4
For this example, I will install Apache.
dnf install httpd php-session php-json php-hash php-ctype php-mbstring php-zip php-gd php-curl php-openssl php-xml mariadb-server
And finally, it installs PHPMyAdmin
dnf --enablerepo=remi install phpMyAdmin
For PHPMyAdmin to run with Apache it is necessary to make a small change in the configuration file
And in the section leave it this way:
<Directory /usr/share/phpMyAdmin> AddDefaultCharset UTF-8 Require all granted </Directory>
Save the changes and close the editor.
To apply the changes in Apache, just restart the service
sudo systemctl restart httpd
Then, open a web browser and go to
http://your-server/phpmyadmin and you will see the following screen:
So, enjoy it.