sammlinux sammlinux
  • Ubuntu
    UbuntuShow More
    How To Install and Use Docker CE on Ubuntu 22.04
    26 Min Read
    How To Install and Secure phpMyAdmin on Ubuntu 22.04
    5 Min Read
    How To Secure SSH with Fail2Ban on Ubuntu 22.04
    8 Min Read
    How To Install Uptime Kuma on Ubuntu 22.04
    17 Min Read
    How To Install Ubuntu Server 22.04 LTS with Screenshots
    14 Min Read
  • Rocky Linux
    Rocky LinuxShow More
    How To Install phpMyAdmin on Rocky Linux 9
    15 Min Read
    How To Secure SSH with Fail2Ban on Rocky Linux 9
    12 Min Read
    How To Install Rocky Linux 9.2 Server with Screenshots
    12 Min Read
    How To Set Up a Firewall Using FirewallD on Rocky Linux 9
    8 Min Read
    How To Install Nginx on Rocky Linux 9: A Comprehensive Guide
    10 Min Read
  • Debian
    DebianShow More
    How To Secure SSH with Fail2Ban on Debian 11
    8 Min Read
    How To Install Debian 11 (Bullseye) Server with Pictures
    12 Min Read
    How To Install and Setup Node.js on Debian 11
    6 Min Read
    How To Install PHP 8.2 on Debian 11
    12 Min Read
    How To Install Nginx on Debian 11: A Comprehensive Guide
    9 Min Read
  • Linux
    LinuxShow More
    Best Practices Linux Server Security for System Administrator
    8 Min Read
    A Simple Guide: How To Manage Groups on Linux
    5 Min Read
    How To Manage Log Files Using Logrotate In Linux
    7 Min Read
    The Easy Ways to Check File Size in Linux
    7 Min Read
    How To Backup Files From Remote Linux VPS Using Rsync Script
    12 Min Read
  • CentOS
    CentOSShow More
    How To Secure SSH with Fail2Ban on CentOS 7
    9 Min Read
    How To Install PHP 8.2 on CentOS 7 / RHEL 7
    18 Min Read
    How To Install Apache Web Server on CentOS 7
    11 Min Read
    How To Set Up a Firewall Using FirewallD on CentOS 7
    5 Min Read
    Initial Setup CentOS 7 Server: Secure and Efficient
    9 Min Read
  • DevOps
    DevOpsShow More
    How To Create AWS CloudFront: A Step-by-Step Guide
    10 Min Read
Reading: How To Install phpMyAdmin on Rocky Linux 9
Share
Font ResizerAa
Linux for BeginnersLinux for Beginners
  • Ubuntu
  • Rocky Linux
  • Debian
  • Linux
  • CentOS
  • DevOps
Search
  • Ubuntu
  • Rocky Linux
  • Debian
  • Linux
  • CentOS
  • DevOps
Follow US
Copyright © 2014-2023 Ruby Theme Ltd. All Rights Reserved.

How To Install phpMyAdmin on Rocky Linux 9

Samuel Siahaan
By Samuel Siahaan
Last updated: April 4, 2026
SHARE

If you’re navigating the world of Rocky Linux 9 and looking to streamline your MariaDB or MySQL database management, installing phpMyAdmin is the way to go. This guide will walk you through the process installation, how to install phpMyAdmin on Rocky Linux 9, ensuring that you can harness the full power of this user-friendly MySQL administration tool on your Rocky Linux 9 system.

Contents
Table of ContentsUnderstanding the Need for phpMyAdminSimplified Database ManagementPrerequisites for Install phpMyAdminInstalling phpMyAdmin on Rocky Linux 9Step 1: Update Your SystemStep 2: Install the EPEL RepositoryStep 3: Install Apache Web ServerStep 4: Install Database ServerStep 5: Install PHPStep 6: Install phpMyAdminStep 7: Create Database for phpMyAdminImport the Database Schema for phpMyAdminStep 8: Configure phpMyAdminStep 9: Access phpMyAdminStep 10: Configure FirewallDConclusion

Table of Contents

  • Understanding the Need for phpMyAdmin
  • Simplified Database Management
  • Prerequisites for Install phpMyAdmin
  • Installing phpMyAdmin on Rocky Linux 9
    • Step 1: Update Your System
    • Step 2: Install the EPEL Repository
    • Step 3: Install Apache Web Server
    • Step 4: Install Database Server
    • Step 5: Install PHP
    • Step 6: Install phpMyAdmin
    • Step 7: Create Database for phpMyAdmin
      • Import the Database Schema for phpMyAdmin
    • Step 8: Configure phpMyAdmin
    • Step 9: Access phpMyAdmin
    • Step 10: Configure FirewallD
  • Conclusion

Understanding the Need for phpMyAdmin

Before we dive into the installation process, let’s take a moment to understand why phpMyAdmin is a valuable addition to your Rocky Linux 9 environment.

Now, let’s explore the advantages of using phpMyAdmin.

Simplified Database Management

phpMyAdmin provides a web-based interface that simplifies the often complex task of managing MySQL databases. With its intuitive GUI (Graphical User Interface), even users without extensive technical expertise can interact with databases seamlessly.

- Advertisement -

Prerequisites for Install phpMyAdmin

Before we dive into the phpMyAdmin installation process, make sure you have the following prerequisites in place:

  • A Rocky Linux 9 system with root or sudo access, to set this up, follow our guide Initial Setup Rocky Linux 9 Server: Secure and Efficient You can deploy this on a physical machine or a virtual environment like VMware or VirtualBox.
  • A stable internet connection to download packages
  • Basic familiarity with command-line operations.

Now that we’ve highlighted the benefits, let’s move on to the step-by-step installation process.

Installing phpMyAdmin on Rocky Linux 9

Follow these steps to install phpMyAdmin on your Rocky Linux 9 and harness its powerful features for your web hosting needs:

Step 1: Update Your System

Before any installation of phpMyAdmin, it’s a good practice to ensure that your system is up-to-date. Open your terminal and run:

$ sudo dnf update

This command will update the package lists and install any available updates.

- Advertisement -

With the system updated, let’s proceed to the next step.

Step 2: Install the EPEL Repository

phpMyAdmin requires the Extra Packages for Enterprise Linux (EPEL) repository. Install it using the following command:

$ sudo dnf install epel-release

This step ensures that you have access to the necessary packages.

- Advertisement -

Now that we have the EPEL repository installed, let’s move on to the phpMyAdmin installation.

Step 3: Install Apache Web Server

PhpMyAdmin is a web-based tool, and to use it, you need to install the Apache web server using the following commands.

$ sudo dnf install httpd

Once installed, start the Apache service and enable it to start at boot.

$ sudo systemctl start httpd
$ sudo systemctl enable httpd

As I have noted before, you can install Apache Web Server by using our previous guides below.

  • How To Install and Configure Apache on Rocky Linux 9

Step 4: Install Database Server

Additionally for installing phpMyAdmin, you’ll require a database server. You have the option to install either MariaDB or MySQL, but for this example, we’ll opt for MariaDB.

$ sudo dnf install mariadb-server

After installation, initiate the MariaDB service and set it to start automatically during boot.

$ sudo systemctl start mariadb
$ sudo systemctl enable mariadb

Now, let’s make sure your MariaDB installation is safe. Run the script, and it will ask you to set a password for the main user, stop remote root logins, and get rid of any anonymous users. Additionally, it will delete the test database, which anonymous users can usually access by default.

$ sudo mariadb-secure-installation
 
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
 
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.
 
Enter current password for root (enter for none): 
OK, successfully used password, moving on...
 
Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.
 
You already have your root account protected, so you can safely answer 'n'.
 
Switch to unix_socket authentication [Y/n] Y
Enabled successfully!
Reloading privilege tables..
 ... Success!
 
You already have your root account protected, so you can safely answer 'n'.
 
Change the root password? [Y/n] Y
New password: [Your Password]
Re-enter new password: [Your Password]
Password updated successfully!
Reloading privilege tables..
 ... Success!
 
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.
 
Remove anonymous users? [Y/n] y
 ... Success!
 
Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.
 
Disallow root login remotely? [Y/n] y
 ... Success!
 
By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.
 
Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!
 
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
 
Reload privilege tables now? [Y/n] y
 ... Success!
 
Cleaning up...
 
All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.
 
Thanks for using MariaDB!

If you want to use MySQL, you can follow this guide

  • How To Install MySQL 8.0 on Rocky Linux 9

Step 5: Install PHP

PhpMyAdmin is built with PHP, so we need to install PHP and some required extensions using the following command.

$ sudo dnf install php php-mysqlnd php-json php-mbstring

For details installation, I recommend referring to the accompanying following tutorial.

  • How To Install PHP 8.2 on Rocky Linux 9

Step 6: Install phpMyAdmin

Next, install PhpMyAdmin on our Linux system by navigating to the web server’s document root directory, which is /var/www/html.

Run the following command for installing phpMyAdmin along with its dependencies:

$ cd /var/www/

Afterwards, retrieve the most recent version of PhpMyAdmin by employing the provided wget command.

$ sudo wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz

After you’ve downloaded the archive, extract its contents and rename the directory for ease of use.

$ sudo tar -xvzf phpMyAdmin-latest-all-languages.tar.gz
$ sudo mv phpMyAdmin-*/ phpmyadmin

Afterward, modify the owner of the ‘phpmyadmin’ directory to the ‘apache’ user using the following chown command:

$ sudo chown -R apache:apache phpmyadmin

Create a configuration file for PhpMyAdmin.

$ sudo cp /var/www/phpmyadmin/config.sample.inc.php /var/www/phpmyadmin/config.inc.php
$ sudo chown -R apache:apache /var/www/phpmyadmin/config.inc.php

Then edit the configuration file:

$ sudo vi /var/www/phpmyadmin/config.inc.php

Find the following line and set your own blowfish_secret:

$cfg['blowfish_secret'] = 'your_password';

Save and exit the file.

Step 7: Create Database for phpMyAdmin

During this phase, you’ll create a fresh database and user specifically for phpMyAdmin. This database will serve as the repository for storing phpMyAdmin configurations.

$ mysql -u root -p

Create a new database named ‘phpmyadmin’ using the provided query.

CREATE DATABASE phpmyadmin;
SELECT PASSWORD('your-strong-password');

Afterward, generate a new user named ‘pma’ with the password encrypted. Subsequently, provide the user with access to the ‘phpmyadmin’ database, and implement the necessary updates.

CREATE USER 'pma'@'localhost' IDENTIFIED VIA mysql_native_password USING '*918DD9A67EC81CE28027875FF141071F088CA7CF';
GRANT SELECT, INSERT, UPDATE, DELETE ON phpmyadmin.* TO 'pma'@'localhost';
FLUSH PRIVILEGES;

Then type ‘quit‘ to exit from the mariadb shell.

Import the Database Schema for phpMyAdmin

Following the creation of the database and user, proceed to import the database schema for phpMyAdmin. Change the working directory to ‘/var/www/phpmyadmin/sql‘.

$ cd /var/www/phpmyadmin/sql

Run the following command to import the database schema into the ‘phpmyadmin’ database.

$ mysql -u root -p phpmyadmin < create_tables.sql

With phpMyAdmin and database installed, the next step is configuring it to work with your web server.

Step 8: Configure phpMyAdmin

phpMyAdmin needs to be configured to work with your web server, typically Apache. In this step, you’ll establish a new Apache/httpd configuration for phpMyAdmin. Additionally, you’ll set up Apache basic authentication to enhance the security of phpMyAdmin.

Navigate to the ‘/etc/httpd/conf.d’ directory and generate a new configuration file named ‘phpmyadmin.conf’ using the vim editor.

$ cd /etc/httpd/conf.d/
$ sudo vi phpmyadmin.conf

Copy and paste the following configuration.

# Alias for accessing phpmyadmin
Alias /phpmyadmin /var/www/phpmyadmin

# document root phpmyadmin
<Directory /var/www/phpmyadmin>

# Enable Basic authentication 
    AuthType Basic
    AuthName "Please Enter Your Password"
    AuthUserFile /var/www/phpmyadmin/.htpasswd
    Require valid-user

#    If you're paranoid - use this and allow a specific IP address
#    Order deny,allow
#    Deny from all
#    Allow from 127.0.0.1
#    Allow from ::1

</Directory>

Press ‘Ctrl+x‘, type ‘y‘, then press ‘Enter‘ to save and exit.

Execute the subsequent command to generate a new Apache basic authentication password. Replace the user ‘samm’ with your own username.

htpasswd -c /var/www/phpmyadmin/.htpasswd samm

Afterward, navigate to the ‘/var/www/phpmyadmin’ directory and craft a new configuration named ‘.htaccess’ using the vim editor.

$ cd /var/www/phpmyadmin/
$ sudo vi .htaccess

Copy and paste the following configuration.

AuthUserFile /var/www/phpmyadmin/.htpasswd
AuthGroupFile /dev/null
AuthName "Secret"
AuthType Basic
require valid-user
<Files ~ "^.(htpasswd|htaccess)$">
    deny from all
</Files>

Then press ‘Ctrl+x‘, type ‘y‘, then press ‘Enter‘ to save and exit.

Subsequently, alter the ownership of the configuration files ‘.htaccess’ and ‘.htpasswd’ (generated using the htpasswd command) to ‘apache’ with the following command.

$ sudo chown apache:apache .htaccess .htpasswd

Ensure the httpd configuration is error-free by conducting a verification. Subsequently, restart the httpd service to implement the recent changes.

Restart Apache to apply the changes:

$ sudo apachectl configtest
$ sudo systemctl restart httpd

Step 9: Access phpMyAdmin

Launch your web browser and enter your server’s IP address, followed by the directory path ‘/phpmyadmin’.

For instance: http://SERVER-IP/phpmyadmin/

Enter the username and password associated with the Apache/httpd basic authentication when prompted.

If your username and password are accurate, you’ll access the phpMyAdmin login page. In case of incorrect credentials, you’ll either be redirected to the same page or encounter a ‘401 Unauthorized’ access message.

Login phpMyAdmin
Login Page phpMyAdmin

On the phpMyAdmin login page, input the database username ‘root’ and the corresponding password. Subsequently, click ‘Go’ to log in to phpMyAdmin.

Step 10: Configure FirewallD

Apache typically utilizes ports 80 and 443 for HTTP and HTTPS by default. To grant access to PhpMyAdmin on your server, execute the following command to open the necessary Apache ports:

$ sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
$ sudo firewall-cmd --zone=public --add-port=443/tcp --permanent
$ sudo firewall-cmd --reload

Executing these commands incorporates a rule that permits incoming traffic on the designated port and then execute firewall reload to implement the modifications.

Congratulations! You’ve successfully installed phpMyAdmin on Rocky Linux 9.

Conclusion

In this guide, we’ve covered the essential steps to installing phpMyAdmin on Rocky Linux 9. By following these straightforward instructions, you now have a powerful tool at your disposal for efficient MySQL database management. Whether you’re a seasoned administrator or just starting with Rocky Linux, phpMyAdmin’s user-friendly interface makes database management a breeze.

As you explore phpMyAdmin on Rocky Linux 9, remember that regular updates and security checks are key to maintaining a robust and stable system.

By incorporating phpMyAdmin into your workflow, you’ve taken a significant step toward optimizing your database management tasks on Rocky Linux 9. Enjoy the benefits of streamlined administration and improved efficiency as you navigate the world of MySQL databases with ease. Happy managing!

Also Read Our Other Guides :

  • How To Install MongoDB 6.0 on Rocky Linux 9
  • How To Install Node.js on Rocky Linux 9 With 3 Different Ways
  • How To Install Varnish Cache for Nginx on Rocky Linux 9
  • The Easy Ways to Check File Size in Linux

Finally, now you have learned how to install phpMyAdmin on Rocky Linux 9.

TAGGED:ApacheMariaDBMySqlPHPphpMyAdminRocky Linux

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
[mc4wp_form]
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Copy Link Print
Previous Article How To Install and Secure phpMyAdmin on Ubuntu 22.04
Next Article Best Practices Linux Server Security for System Administrator
How To Install and Secure phpMyAdmin on Ubuntu 22.04
Ubuntu
Install and Configure Docker Swarm Mode on Centos 7
CentOS
How To Install and Config Thumbor on Debian 10
Debian
How To Install MariaDB 10.6 on Debian 11 Server
Debian
How To Install MongoDB 6.0 on Debian 10 & 11
Debian

You Might Also Like

Debian

How To Install Apache Solr 9.1 on Debian 11

9 Min Read
Rocky Linux

How To Install MongoDB 6.0 on Rocky Linux 9

18 Min Read
Rocky Linux

How To Install Varnish Cache for Nginx on Rocky Linux 9

14 Min Read
Rocky Linux

How To Install Python 3.11 on Rocky Linux 9

14 Min Read
Rocky Linux

How To Build NGINX from Source (Compile) on Rocky Linux 9

14 Min Read
Rocky Linux

How To Install a MinIO Object Storage Server on Rocky Linux (Part 1)

16 Min Read
Ubuntu

How To Install DBeaver Community on Ubuntu 22.04

7 Min Read
Rocky Linux

How To Install MySQL 8.0 on Rocky Linux 9

20 Min Read
Show More

Always Stay Up to Date

Subscribe to our newsletter to get our newest articles instantly!

sammlinux sammlinux

Providing beginner-friendly Linux tutorials and open-source guides to simplify your digital infrastructure.

www.sammlinux.com © 2026 | All Rights Reserved

Join Us!
Subscribe to our newsletter and never miss our latest news, podcasts etc.

Subscribe to our newsletter to get our newest articles instantly!

Zero spam, Unsubscribe at any time.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?