🗄ī¸How to Install PhpMyAdmin to Manage the Database Using User Interfaces

Good to know : What is PhpMyAdmin

PhpMyAdmin is a free software written in PHP and is the most popular software used to manage tables and data in databases via the web. PhpMyAdmin supports various database operations such as MySQL and MariaDB. The intended tasks include managing databases, tables, columns, indexes, users, permissions, etc. All these tasks can be executed through a user-friendly user interface. However, even though phpMyAdmin has a user interface you can still execute MySQL statements and queries directly.

PhpMyadmin is very popular for managing databases because it can be accessed via a web browser. Apart from what was mentioned previously, we can also create, update, change, delete, import and export MySQL database tables using this software. You can also run MySQL queries, repair, optimize, check tables, and also run other database management commands. PhpMyAdmin can also be used to perform administrative tasks such as database creation and query execution.


Configuration

Install Package

apt install php php-cgi php-mysqli php-pear php-mbstring php-gettext libapache2-mod-php php-common php-phpseclib php-mysql -y
apt install mariadb-server mariadb-client -y
apt install gnupg -y

Configuration Database

Create Database

mysql -u root -p
CREATE DATABASE db_phpmyadmin;
CREATE USER 'adminrizwan'@'localhost' IDENTIFIED BY '123';
GRANT ALL PRIVILEGES ON *.* TO 'adminrizwan'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Create & Move to New Directory

mkdir /var/www/phpmyadmin
cd /var/www/phpmyadmin

Install Package PhpMyAdmin

Installer PhpMyAdmin

wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz --no-check-certificate
wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz.asc --no-check-certificate

Check Digital Signature File Installer

wget https://files.phpmyadmin.net/phpmyadmin.keyring --no-check-certificate
gpg --import phpmyadmin.keyring

Unpack File Installer

tar xvf phpMyAdmin-latest-all-languages.tar.gz --strip-components=1 -C /var/www/phpmyadmin

VirtualHost For PhpMyAdmin

Create File VirtualHost

nano /etc/apache2/sites-available/phpmyadmin.conf
<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName phpmyadmin.rizwanpemula.com
    DocumentRoot /var/www/phpmyadmin
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Enable File VirtualHost

a2ensite phpmyadmin.conf

Restart Service

systemctl reload apache2 && systemctl start apache2

Configuration is Completed

Check Service PhpMyAdmin

phpmyadmin.rizwanpemula.com

username : adminrizwan
password : 123

Last updated