Your IT Lab

Setup phpMyAdmin on AlmaLinux

Setup phpMyAdmin on AlmaLinux

Install and configure phpMyAdmin on AlmaLinux to manage MariaDB and MySQL databases from your browser.

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:

AlmaLinux 8 is installed on your Liquid Web server.

Root or sudo access via SSH.

A working LAMP stack (Linux, Apache, MySQL/MariaDB, PHP). Learn how to install a LAMP stack on AlmaLinux.

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

3. 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.

4. Install phpMyAdmin and its dependencies by running the following command:

sudo dnf --enablerepo=remi install phpMyAdmin

5. 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.

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

2. 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.

3. Save and exit (CTRL+O, then CTRL+X).

4. Check Apache configuration:

sudo httpd -t

5. Restart Apache

sudo systemctl restart httpd

How to update phpMyAdmin

1. Check for updates

sudo dnf update phpmyadmin

2. Apply updates if available:

sudo dnf update phpmyadmin

3. Restart Apache

sudo systemctl restart httpd

Uninstalling phpMyAdmin

1. Uninstall phpMyAdmin

sudo dnf remove phpmyadmin

(Optional) Remove its Apache configuration:

sudo rm /etc/httpd/conf.d/phpMyAdmin.conf

2. Restart Apache

sudo systemctl restart httpd

Source: liquidweb.com