Friday, November 15, 2024
Google search engine
HomeData Modelling & AIInstall and Configure phpMyAdmin on Fedora 38/37/36/35/34/33

Install and Configure phpMyAdmin on Fedora 38/37/36/35/34/33

In this guide, we will look at how to Install and Configure phpMyAdmin on Fedora 38/37/36/35/34/33. PHPMyAdmin is an open source software tool written in PHP, intended to handle the administration of MySQL over the Web interface.

phpMyAdmin has support for a wide range of operations on MySQL, MariaDB, and Drizzle. It is often used to perform common Database operations (managing databases, tables, columns, relations, indexes, users, permissions, etc) through an intuitive and easy to use web interface.

Follow the steps below to Install phpMyAdmin on Fedora Linux system.

Step 1: Install Apache HTTP Server and PHP

Apache HTTP server and PHP are required dependencies for phpMyAdmin. Install them first :

sudo dnf -y install httpd php php-cli php-php-gettext php-mbstring php-mcrypt php-mysqlnd php-pear php-curl php-gd php-xml php-bcmath php-zip

Configure httpd basic settings:

Edit the configuration file /etc/httpd/conf/httpd.conf and set:

ServerAdmin [email protected]
ServerName  example.com
ServerTokens Prod

You can optionally set Keepalive:

KeepAlive On

Enable and start httpd service:

sudo systemctl start httpd
sudo systemctl enable httpd

If you have firewalld running, allow both http and https services:

sudo firewall-cmd --add-service={http,https} --permanent
sudo firewall-cmd --reload

Confirm your installed PHP version:

$ php -v
PHP 8.1.5 (cli) (built: Apr 12 2022 16:19:58) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.1.5, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.5, Copyright (c), by Zend Technologies

Loaded extensions can be viewed by passing -m option to the phpcommand

$ php -m

Set PHP timezone on the file /etc/php.ini

date.timezone = Africa/Nairobi

See a complete List of Supported Timezones.

Step 2: Install phpMyAdmin on Fedora

After PHP and Apache have been installed, you can install phpMyAdmin on Fedora .

sudo dnf -y install phpMyAdmin

Check the version of phpMyAdmin installed on your Fedora.

$ rpm -qi phpMyAdmin
Name        : phpMyAdmin
Version     : 5.2.0
Release     : 2.fc37
Architecture: noarch
Install Date: Thu 19 Jan 2023 02:13:44 PM UTC
Group       : Unspecified
Size        : 46210123
License     : GPLv2+ and MIT and BSD and LGPLv3 and MPLv2.0
Signature   : RSA/SHA256, Fri 22 Jul 2022 02:51:57 PM UTC, Key ID f55ad3fb5323552a
Source RPM  : phpMyAdmin-5.2.0-2.fc37.src.rpm
Build Date  : Fri 22 Jul 2022 02:46:46 PM UTC
Build Host  : buildvm-ppc64le-14.iad2.fedoraproject.org
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : https://www.phpmyadmin.net/
Bug URL     : https://bugz.fedoraproject.org/phpMyAdmin
Summary     : A web interface for MySQL and MariaDB
....

Limiting access to phpMyAdmin from known networks

Limit access to phpMyAdmin to your only trusted networks

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

Edit the Require ip lines – both on Line 17 and 34 of the file.

# Add your local subnet
Require ip 127.0.0.1 192.168.18.0/24

Save the changes and restart httpd service

sudo systemctl restart httpd

Step 3: Access phpMyAdmin interface on Fedora

Access  [http://(your hostname or IP address)/phpmyadmin/] from your favorite web browser and network whitelisted.

Login with your Database user to start administering database operations from phpMyAdmin web interface.

Step 4: Change Authentication Plugin for MySQL 8.0

To be able to authenticate to MySQL 8.0, login to MySQL CLI and change  Authentication Plugin.

$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 26
Server version: 8.0.13 MySQL Community Server - GPL

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'ph/axo>vJe;789';
Query OK, 0 rows affected (0.11 sec)

mysql> QUIT
Bye

Enjoy administering your MySQL or MariaDB database server with phpMyAdmin.

Recommended books to read:

Don’t forget to check other Fedora articles available on our website.

Dominic Rubhabha-Wardslaus
Dominic Rubhabha-Wardslaushttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Recent Comments