Learn how to install phpMyAdmin on Rocky Linux 8 with this step-by-step guide. Easily manage your MySQL databases through a web interface by following our detailed instructions. #centlinux #linux #mysql
Table of Contents
What is phpMyAdmin?
phpMyAdmin is a free, open-source web-based tool written in PHP that is used to manage MySQL and MariaDB databases. It provides an easy-to-use graphical interface, allowing users to perform various database management tasks without needing to write SQL commands directly. Here are some key features and functionalities of phpMyAdmin:
- User-Friendly Interface: Offers an intuitive web interface for managing databases, tables, columns, relations, indexes, users, permissions, and more.
- Database Management: Allows users to create, modify, and delete databases and their components, such as tables, fields, and indexes.
- SQL Execution: Enables the execution of SQL queries, including complex queries, through an interactive interface.
- Data Import/Export: Supports importing data from CSV, SQL, and other formats, and exporting data to various formats like CSV, SQL, XML, and more.
- Backup and Restore: Provides tools for creating database backups and restoring data from backups, ensuring data integrity and security.
- User Management: Facilitates the creation and management of database users and their permissions, enhancing security and access control.
- Database Optimization: Includes features for optimizing database performance, such as repairing and analyzing tables.
- Multilingual Support: Available in multiple languages, making it accessible to a global audience.
- Extensions and Plugins: Supports various extensions and plugins to extend its functionality and integrate with other tools and platforms.
phpMyAdmin is widely used by developers, database administrators, and anyone who needs to manage MySQL or MariaDB databases due to its ease of use, robust feature set, and flexibility.

phpMyAdmin Alternatives
There are several alternatives to phpMyAdmin for managing MySQL and MariaDB databases. Some popular alternatives include:
- Adminer: A lightweight, user-friendly database management tool written in PHP. Adminer provides a similar interface to phpMyAdmin but with a smaller footprint and simpler design.
- DBeaver: A universal database tool that supports multiple database management systems, including MySQL, PostgreSQL, SQLite, and more. DBeaver offers a rich set of features for database development, administration, and analysis.
- HeidiSQL: A powerful SQL client for Windows that allows users to manage MySQL, MariaDB, and Microsoft SQL Server databases. HeidiSQL offers a user-friendly interface with features like syntax highlighting, code completion, and data browsing.
- MySQL Workbench: An official graphical tool provided by MySQL for database development, administration, and management. MySQL Workbench offers features like SQL development, data modeling, server administration, and database migration.
- Navicat: A comprehensive database management and development tool that supports multiple database systems, including MySQL, PostgreSQL, Oracle, SQL Server, and more. Navicat provides a wide range of features for database design, administration, and maintenance.
These alternatives offer different features, interfaces, and capabilities, so you can choose the one that best fits your requirements and preferences.
Recommended Training: The Ultimate MySQL Bootcamp: Go from SQL Beginner to Expert from Colt Steele

Environment Specification
We are using the same Linux virtual machine, where we have installed MariaDB database server in our previous article. Virtual machine specifications are:
- CPU – 3.4 Ghz (2 cores)
- Memory – 2 GB
- Storage – 20 GB
- Operating System – Rocky Linux 8.5 (Green Obsidian)
- Hostname – mariadb-01.centlinux.com
- IP Address – 192.168.116.128 /24
Amazon Fire HD 10 tablet (newest model) built for relaxation, 10.1″ vibrant Full HD screen, octa-core processor, 3 GB RAM, 32 GB, Black
$94.99 (as of April 17, 2025 15:58 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Update your Rocky Linux Server
By using a SSH client software, login to mariadb-01.centlinux.com as root user.
Rebuild cache of installed yum repositories.
dnf makecache
Execute following command to update your Rocky Linux server.
dnf update -y
Check the Linux Operating System and Kernel versions as follows.
cat /etc/rocky-release && uname -r
Output:
Rocky Linux release 8.5 (Green Obsidian)
4.18.0-348.20.1.el8_5.x86_64
Install Apache & PHP on Rocky Linux 8
phpMyAdmin is PHP based web application, therefore, you are required to install a PHP supported web server to deploy phpMyAdmin software.
You can install Apache HTTP server on your Linux machine as follows.
dnf install -y @httpd
You are also required to install PHP support on your web server.
Check the available PHP modules in your enabled yum repositories.
dnf module list php
Output:
Last metadata expiration check: 0:02:04 ago on Thu 14 Apr 2022 10:49:04 PM PKT.
Rocky Linux 8 - AppStream
Name Stream Profiles Summary
php 7.2 [d] common [d], devel, minimal PHP scripting language
php 7.3 common [d], devel, minimal PHP scripting language
php 7.4 common [d], devel, minimal PHP scripting language
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
We are installing phpMyAdmin 5.1.3 that requires PHP 7.1.3 or later.
Therefore, you may install PHP 7.4 on your Rocky Linux server.
dnf module install php:7.4
Install necessary PHP packages in one single dnf statement as follows.
dnf install -y php-common php-opcache php-cli php-gd php-curl php-mysqlnd php-xml wget policycoreutils-python-utils
Enable and start Apache and PHP services.
systemctl enable --now httpd.service php-fpm.service
We will use the HTTPS port for better security in this article. Therefore, you have to allow the HTTPS in Linux firewall.
firewall-cmd --permanent --add-service=https
firewall-cmd --reload
Docker: A Project-Based Approach to Learning
$3.99 (as of April 17, 2025 15:57 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Install phpMyAdmin on Rocky Linux 8
phpMyAdmin is a free and open-source software that provides a web-based interface for managing MySQL or MariaDB databases. As an open-source project, it is freely available for download from its official website, making it accessible for anyone looking to simplify database administration tasks. phpMyAdmin’s ease of use, combined with its rich set of features, has made it a popular choice for database management across many Linux distributions.
At the time of writing this article, phpMyAdmin version 5.1.3 is the latest stable release available for download. This version includes several enhancements and bug fixes, making it a reliable choice for those seeking a robust database management solution. To download phpMyAdmin directly to your Linux system, you can copy the URL of the desired version from the official phpMyAdmin website. Once you have the URL, you can use the wget
command to download the software package directly from the Linux command line, making the process quick and straightforward.
cd /tmp
wget https://files.phpmyadmin.net/phpMyAdmin/5.1.3/phpMyAdmin-5.1.3-english.tar.gz
By using tar command, extract downloaded zip file in Apache’s document root directory.
tar xvf phpMyAdmin-5.1.3-english.tar.gz --directory /var/www/html
Rename the extracted directory to a simple name for easy accessibility.
cd
mv /var/www/html/phpMyAdmin-5.1.3-english/ /var/www/html/pma
phpMyAdmin software provides a SQL script to create it’s repository in MySQL database.
You can execute this script as follows.
mysql -u root -p < /var/www/html/pma/sql/create_tables.sql
Create a copy of phpMyAdmin configuration file to customize it according to your requirements.
cp /var/www/html/pma/config.sample.inc.php /var/www/html/pma/config.inc.php
Open phpMyAdmin configuration file in vim text editor.
vi /var/www/html/pma/config.inc.php
Find and set following directive in this file.
$cfg['blowfish_secret'] = 'I;Am;Fan;0f;0p3n;S0urc3;S0ftwar3'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
Create a temporary directory to cache templates by phpMyAdmin.
mkdir /var/www/html/pma/tmp
Set apache user as owner of phpMyAdmin software directory.
chown -R apache:apache /var/www/html/pma/
Set SELinux permissions for tmp directory, to make it writable by the apache user.
semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/pma/tmp(/.*)?"
restorecon -Rv /var/www/html/pma/tmp
Output:
Relabeled /var/www/html/pma/tmp from unconfined_u:object_r:httpd_sys_content_t:s0 to unconfined_u:object_r:httpd_sys_rw_content_t:s0
Login to MySQL database server.
mysql -u root -p
Create an admin user for phpMyAdmin.
CREATE USER ahmer@localhost IDENTIFIED BY 'pma';
GRANT ALL ON *.* TO ahmer@localhost;
FLUSH PRIVILEGES;
EXIT
Open URL https://mariadb-01.centlinux.com/pma/ in a web browser.

Login as MySQL admin user.

Frequently Asked Questions (FAQs)
1. Is phpMyAdmin secure?
By default, phpMyAdmin can be secure if properly configured. Always:
- Use strong passwords.
- Restrict access via IP (e.g., in
config.inc.php
). - Keep PHP and phpMyAdmin updated.
- Avoid exposing it publicly without HTTPS.
2. How do I access phpMyAdmin?
You can access it by entering http://localhost/phpmyadmin
in your web browser if installed locally (e.g., via XAMPP, WAMP, or MAMP).
3. How do I create a new database in phpMyAdmin?
Click the “Databases” tab, enter a name for your database, choose a collation (e.g., utf8_general_ci
), and click “Create.”
4. How do I import/export a database?
- Import: Go to the database, click “Import,” choose your SQL file, and click “Go.”
- Export: Select the database, click “Export,” choose your format (e.g., SQL), and click “Go.”
5. How do I run SQL queries in phpMyAdmin?
Click the “SQL” tab in your database, type your query (e.g., SELECT * FROM users;
), and click “Go” to execute it.
Gtheos 2.4GHz Wireless Gaming Headset for PS5, PS4 Fortnite & Call of Duty/FPS Gamers, PC, Nintendo Switch, 7.1 Surround Sound, Bluetooth 5.3 Gaming Headphones with ENC Mic, 40+Hr Battery – Space Gray
$39.99 (as of April 17, 2025 16:01 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Final Thoughts
Installing phpMyAdmin on Rocky Linux 8 provides an efficient and user-friendly way to manage MySQL or MariaDB databases through a web-based interface. By following the installation steps—installing the required dependencies, configuring the EPEL repository, downloading phpMyAdmin, and setting up the web server—you can seamlessly integrate this powerful tool into your system.
With phpMyAdmin, database management tasks such as creating, modifying, and deleting databases, tables, and users become much simpler, especially for those who prefer a graphical interface over command-line operations. Rocky Linux 8’s stability, combined with phpMyAdmin’s versatility, makes it an excellent choice for database administrators and developers alike. Whether you’re managing a single database or overseeing complex applications, this setup ensures accessibility, security, and efficiency for all your database management needs.
Struggling with Linux server management? I offer professional support to ensure your servers are secure, optimized, and always available. Visit my Fiverr profile to learn more!
Leave a Reply
You must be logged in to post a comment.