How to install phpMyAdmin on Rocky Linux

Databases are significantly simpler to handle from inside a GUI. In case you’ve migrated your servers from CentOS to Rocky Linux, you may need to set up phpMyAdmin. Jack Wallen exhibits you ways.

database administrator working

Picture: iStock/GaudiLab

In case you’re a database administrator, and you must handle both MySQL or MariaDB in your information middle servers, you realize the good thing about having a great GUI to make the duty a bit extra environment friendly. And in case your servers have migrated from CentOS to Rocky Linux, you could be a bit fearful about getting such a GUI up and operating. Fret not. There’s at all times phpMyAdmin.

The issue with phpMyAdmin is that the set up on Rocky Linux (and most RHEL clones) is not almost as easy as it’s with Ubuntu. However I am going that will help you out with that. As soon as you’ve got walked via this tutorial, you will have phpMyAdmin up and operating in minutes.

Are you prepared?

SEE: Kubernetes: A cheat sheet (free PDF) (TechRepublic)

What you will want

To get phpMyAdmin put in, you will want a operating occasion of Rocky Linux and a consumer with sudo privileges. That is it. Let’s get to work.

The best way to set up Apache and MySQL

Prior to installing the net and database server, make sure that to replace Rocky Linux with:

sudo dnf replace -y

After the replace completes, reboot (if the kernel is up to date) after which set up the webserver with:

sudo dnf set up httpd -y

Begin and allow the webserver with:

sudo systemctl begin httpd
sudo systemctl allow httpd

Subsequent, we have to permit HTTP providers via the firewall with the next instructions:

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

Now, we are able to set up the database with:

sudo dnf set up mysql-server mysql -y

Begin and allow MySQL:

sudo systemctl begin mysqld
sudo systemctl allow mysqld

Safe the database set up with:


The best way to set up PHP

We now want to put in PHP, which is completed in a a lot totally different method than it’s on Ubuntu. First, let’s reset the php module with:

sudo dnf module reset php

Now, we are able to allow PHP 7.4 with:

sudo dnf module allow php:7.4

Now we are able to set up PHP and the varied modules required for phpMyAdmin with:

sudo dnf set up php php-common php-opcache php-cli php-gd php-curl php-mysqlnd php-xml -y

The best way to obtain and unpack phpMyAdmin

Subsequent, we’ll obtain the phpMyAdmin file with the command:

wget https://recordsdata.phpmyadmin.web/phpMyAdmin/5.1.1/

Make sure that to test the official obtain web page to make sure you’re downloading the latest model.

Unpack the file with:

unzip phpMyAdmin-*

If unzip is not put in, set up it with:

sudo dnf set up unzip -y

Transfer and rename the newly created listing with:

sudo mv phpMyAdmin-*-all-languages /usr/share/phpmyadmin

The best way to configure phpMyAdmin

For our subsequent trick, we’ll configure phpMyAdmin. Turn into the phpmyadmin listing with:

cd /usr/share/phpmyadmin

Copy the pattern configuration file with the command:

sudo mv

Now, we have to generate a 32-bit secret string with:

openssl rand -base64 32

Copy the resultant string.

Open the phpMyAdmin configuration file with the command:

sudo nano

In that file, search for the road:

$cfg['blowfish_secret'] = '';

Paste the 32-bit secret string between the 2 single quotes.

Scroll right down to the Directories for saving/loading recordsdata from sever part and add the next line:

$cfg['TempDir'] = '/tmp';

Save and shut the file. 

Create a brand new tmp listing and provides the every little thing the required permissions/possession with the next instructions:

sudo mkdir /usr/share/phpmyadmin/tmp
sudo chown -R apache:apache /usr/share/phpmyadmin
sudo chmod 777 /usr/share/phpmyadmin/tmp

The best way to create an Apache config file

Our subsequent step is to create an Apache config file with the command:

sudo nano /and so on/httpd/conf.d/phpmyadmin.conf

In that file, paste the next:

Alias /phpmyadmin /usr/share/phpmyadmin
<Listing /usr/share/phpmyadmin/>
   AddDefaultCharset UTF-8
   <IfModule mod_authz_core.c>
     # Apache 2.4
      Require all granted

<Listing /usr/share/phpmyadmin/setup/>
   <IfModule mod_authz_core.c>
# Apache 2.4
       Require all granted

Save and shut the file.

The best way to set the SELinux insurance policies

To ensure that SELinux to permit site visitors to the choice location (/usr/share/phpmyadmin), we have to make it conscious. To try this, concern the command:

sudo chcon -Rv --type=httpd_sys_content_t /usr/share/phpmyadmin/*

Restart Apache with the command:

sudo systemctl restart httpd

The best way to entry the phpMyAdmin net interface

Every thing ought to now be able to go. Open an internet browser and level it to http://SERVER/phpmyadmin (The place SERVER is the IP tackle of your internet hosting server) and try to be prompted for the login credentials. 

Congratulations, you’ve got simply put in phpMyAdmin on Rocky Linux, for simpler MySQL database administration.

Additionally see

Recent Articles


Related Stories

Leave A Reply

Please enter your comment!
Please enter your name here

Stay on op - Ge the daily news in your inbox