Setup phpMyAdmin on Linux (AlmaLinux)
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
- Connect to your server using SSH
- Clean cached package data and update your system:
sudo dnf clean all
sudo dnf update- 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- 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 ~]#- 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
- Open the Apache includes file for phpMyAdmin:
sudo nano /etc/httpd/conf.d/phpMyAdmin.conf- 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>- Save and exit (CTRL+O, then CTRL+X).
- Check Apache configuration:
sudo httpd -t- Restart Apache
sudo systemctl restart httpdHow to update phpMyAdmin
- Check for updates
sudo dnf update phpmyadmin- Apply updates if available:
sudo dnf update phpmyadmin- Restart Apache
sudo systemctl restart httpdUninstalling phpMyAdmin
- Uninstall phpMyAdmin
sudo dnf remove phpmyadmin- (Optional) Remove its Apache configuration:
sudo rm /etc/httpd/conf.d/phpMyAdmin.conf- Restart Apache
sudo systemctl restart httpdUsing phpMyAdmin
Once installed, phpMyAdmin provides the following features:
- Create databases – Click New, enter a name, and choose collation.
- Create tables – Define a table name and columns within a database.
- Run SQL queries – Use the SQL tab to execute custom queries.
- Backup databases – Use Export to save SQL or CSV files.
- Restore databases – Use Import to upload backups.
- Manage users – Use User accounts to add or remove database users and assign privileges.
Troubleshooting & FAQs
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.