How To Install PhpMyAdmin On Debian 11.3
To Install PhpMyAdmin On Linux Debian 11.3
Introduction:
PhpMyAdmin is a free and open-source administration tool for MySQL and MariaDB. In addition to being a portable web application written primarily in PHP, it has become one of the most popular MySQL administration tools, particularly for web hosting services.
Installation Steps:
Step 1: Check the Version of Debian Linux by using the below command
[root@linuxhelp ]# lsb_release -v
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
Step 2: Update server packages to latest version by using the below command
[root@linuxhelp ]# apt update
Hit:1 http://security.debian.org/debian-security bullseye-security InRelease
Reading state information... Done
All packages are up to date.
Step 3: Install Phpadmin by using the below command
[root@linuxhelp ]# apt install phpmyadmin -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libapache2-mod-php7.4 php7.4
Creating config file /etc/phpmyadmin/config-db.php with new version
checking privileges on database phpmyadmin for phpmyadmin@localhost: user creation needed.
dbconfig-common: flushing administrative password
apache2_invoke: Enable configuration phpmyadmin
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for php8.1-cli (8.1.7-1+0~20220614.21+debian11~1.gbpb08a43) ...
Processing triggers for libapache2-mod-php8.1 (8.1.7-1+0~20220614.21+debian11~1.gbpb08a43) ...
Step 4: Login into MySQL Database root by using the below command
[root@linuxhelp ]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 51
Server version: 10.5.15-MariaDB-0+deb11u1 Debian 11
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
Step 5: List the Database by using the below command
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| phpmyadmin |
+--------------------+
4 rows in set (0.008 sec)
Step 6: Change the Database to PhpMyAdmin by using the below command
MariaDB [(none)]> use phpmyadmin;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
Step 7: Create User and Password for PhpMyAdmin by using the below command
MariaDB [phpmyadmin]> create user user@localhost identified by 'Linuxc#4';
Query OK, 0 rows affected (0.001 sec)
Step 8: Grant all Permissions by using following commands
MariaDB [phpmyadmin]> grant all on phpmyadmin.* to user@localhost;
Query OK, 0 rows affected (0.006 sec)
Step 9: Give Privileges by using the below command
MariaDB [phpmyadmin]> flush privileges;
Query OK, 0 rows affected (0.002 sec)
Step 10: Exit the MySQL database by using the below command
MariaDB [phpmyadmin]> exit
Bye
Step 11: Restart the apache by using the below command.
[root@linuxhelp ]# systemctl restart apache2
Step 12: Install Phpadmin Dependency Package by using the below command
[root@linuxhelp ]# apt install php7.4-mysqli
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'php7.4-mysql' instead of 'php7.4-mysqli'
The following packages were automatically installed and are no longer required:
libapache2-mod-php7.4 php7.4
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
libapache2-mod-php7.4 php7.4-cli php7.4-common php7.4-curl php7.4-json php7.4-mbstring php7.4-opcache php7.4-readline php7.4-zip
Suggested packages:
php-pear
The following NEW packages will be installed:
php7.4-mysql
Step 13: Restart the apache by using the below command.
[root@linuxhelp ]# systemctl restart apache2
Conclusion:
We have reached the end of this article. In this guide, we have walked you through the steps required to install phpMyAdmin on Linux Debian 11.3. Your feedback is much welcome