Help Docs Server Administration Server Database Management phpMyAdmin Web-Based Database Management Setup phpMyAdmin on Linux (AlmaLinux)

Setup phpMyAdmin on Linux (AlmaLinux)

Our helpful guide shows you how to install phpMyAdmin on AlmaLinux to easily manage your MariaDB or MySQL databases. 

Introduction

This guide shows you how to install and configure phpMyAdmin on AlmaLinux for self-managed servers at Liquid Web. phpMyAdmin is a web-based application that makes managing MariaDB and MySQL databases easier. Perform most database tasks from your browser without the need of command-line tools. 

This is useful if you want:

  • A simple interface for creating, modifying, or deleting databases and tables.
  • Tools for running SQL queries, importing/exporting data, and managing users.
  • Easier database administration without needing additional desktop software.

Prerequisites

Before you start, make sure you have:

Installation Steps

  1. Connect to your server using SSH
  2. Clean cached package data and update your system:
sudo dnf clean all
sudo dnf update

  1. Enable EPEL and REMI repositories because phpMyAdmin is not available in the default AlmaLinux repos.
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm

Potential repository compatibility issues
Installing from EPEL or REMI on a production server can cause compatibility issues. Test on a staging server first.

  1. Install phpMyAdmin and its dependencies by running the following command:
sudo dnf --enablerepo=remi install phpMyAdmin


Here is the output:

[root@test ~]# sudo dnf --enablerepo=remi install phpMyAdmin

Remi's RPM repository for Enterprise Linux 8 - x86_64                                                                                                                                                         2.0 MB/s | 3.6 MB     00:01    

Remi's Modular repository for Enterprise Linux 8 - x86_64                                                                                                                                                     765 kB/s | 927 kB     00:01    

Safe Remi's RPM repository for Enterprise Linux 8 - x86_64                                                                                                                                                    1.6 MB/s | 2.0 MB     00:01    

Last metadata expiration check: 0:00:01 ago on Monday 12 August 2024 09:37:46 AM EDT.

Dependencies resolved.

==============================================================================================================================================================================================================================================

 Package                                              Architecture                                    Version                                                                        Repository                                          Size

==============================================================================================================================================================================================================================================

Installing:

 phpMyAdmin                                           noarch                                          5.2.1-1.el8.remi                                                               remi                                               8.9 M

Installing dependencies:

 php-process                                          x86_64                                          7.2.24-1.module_el8.3.0+2010+7c76a223                                          appstream                                           83 k

Transaction Summary

==============================================================================================================================================================================================================================================

Install  2 Packages

Total download size: 9.0 M

Installed size: 48 M

Is this ok [y/N]: y

Downloading Packages:

(1/2): php-process-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64.rpm                                                                                                                                           469 kB/s |  83 kB     00:00    

(2/2): phpMyAdmin-5.2.1-1.el8.remi.noarch.rpm                                                                                                                                                                 4.1 MB/s | 8.9 MB     00:02    

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Total                                                                                                                                                                                                         3.6 MB/s | 9.0 MB     00:02     

Running transaction check

Transaction check succeeded.

Running transaction test

Transaction test succeeded.

Running transaction

  Running scriptlet: phpMyAdmin-5.2.1-1.el8.remi.noarch                                                                                                                                                                                   1/1 

  Preparing        :                                                                                                                                                                                                                      1/1 

  Installing       : php-process-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                                                                                                             1/2 

  Installing       : phpMyAdmin-5.2.1-1.el8.remi.noarch                                                                                                                                                                                   2/2 

  Running scriptlet: phpMyAdmin-5.2.1-1.el8.remi.noarch                                                                                                                                                                                   2/2 

  Verifying        : php-process-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                                                                                                             1/2 

  Verifying        : phpMyAdmin-5.2.1-1.el8.remi.noarch                                                                                                                                                                                   2/2 

Installed:

  php-process-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                         phpMyAdmin-5.2.1-1.el8.remi.noarch                                                                        

Complete!

[root@test ~]#

  1. Access the phpMyAdmin using your MariaDB / MySQL credentials (for example, root) via the GUI available at: http://your-server-ip/phpMyAdmin. Replace your-server-ip with your server’s IP address or domain name. For example, the URL you use may resemble the http://192.168.1.100/phpMyAdmin URL.
  1. Once logged in, you should see the phpMyAdmin dashboard.

How to allow access to phpMyAdmin from a specific IP

  1. Open the Apache includes file for phpMyAdmin:
sudo nano /etc/httpd/conf.d/phpMyAdmin.conf

  1. Add the IP restriction code:
<Directory /usr/share/phpMyAdmin/>

    <IfModule mod_authz_core.c>

        Require ip 127.0.0.1 192.168.1.100

    </IfModule>

</Directory>

Allow Only Trusted IPs
List multiple IPs separated by spaces. Only allow trusted IPs to keep your server secure.

  1.  Save and exit (CTRL+O, then CTRL+X).
  2.  Check Apache configuration:
sudo httpd -t

  1. Restart Apache
sudo systemctl restart httpd

How to update phpMyAdmin

  1. Check for updates
sudo dnf update phpmyadmin

  1. Apply updates if available:
sudo dnf update phpmyadmin

  1. Restart Apache
sudo systemctl restart httpd

Uninstalling phpMyAdmin

  1. Uninstall phpMyAdmin
sudo dnf remove phpmyadmin

  1. (Optional) Remove its Apache configuration:
sudo rm /etc/httpd/conf.d/phpMyAdmin.conf

  1. Restart Apache
sudo systemctl restart httpd

Using phpMyAdmin

Once installed, phpMyAdmin provides the following features:

Troubleshooting & FAQs

You can reset your MariaDB root password by starting MariaDB with the –skip-grant-tables option and then updating the password from the MySQL shell.

Ensure that Apache is running and that ports 80 (HTTP) and 443 (HTTPS) are open in the firewall. You can check that by running:

sudo systemctl status httpd

If you want to add the standard HTTP and HTTPS ports, run the following:

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload

Yes. If SELinux is enforced, Apache may be blocked from connecting to the database. You can allow access with this command:

sudo setsebool -P httpd_can_network_connect_db 1

About your phpMyAdmin installation on Linux and optimal hosting with Liquid Web

Installing phpMyAdmin on AlmaLinux provides a user-friendly way to manage databases. On self-managed servers, you are responsible for updates, security, and performance.

Choosing the right Liquid Web hosting plan ensures your server runs smoothly. Liquid Web provides reliable servers, expert support, and flexible options to keep your phpMyAdmin setup secure and efficient.– {Note} For Ubuntu servers, refer to How to install phpMyAdmin on Ubuntu for detailed instructions.

Was this article helpful?