How to Install phpMyAdmin on Ubuntu 22.04

phpMyAdmin is one of the most popular applications for MySQL database management. It is a free tool written in PHP. Through this software, you can create, alter, drop, delete, import and export MySQL database tables.

In this tutorial, i am going to show you how to install and configure PHPMyadmin on ubuntu 22.04 system.

How to install phpMyAdmin on Ubuntu 22.04

Just follow the below given steps to install and configure phpMyAdmin on ubuntu 22.04 system:

  • Step 1 – Update System Dependencies
  • Step 2 – Install PhpMyAdmin
  • Step 3 – Configure PHPMyAdmin
  • Step 4 – Restart Apache Server
  • Step 5 – Login to PHPMyAdmin

Step 1 – Update System Dependencies

Open command prompt and execute the following command to update latest system dependencies:

sudo apt update

Step 2 – Install PhpMyAdmin

Run the following command to install phpmyadmin on ubuntu 22.04 system:

sudo apt install phpmyadmin

Step 3 – Configure PHPMyAdmin

Run the following command on command prompt to configure phpmyadmin for Apache:

sudo nano /etc/apache2/conf-available/phpmyadmin.conf

After that, add the following line into apache2.conf file and save it:

Alias /phpmyadmin /var/www/html/phpmyadmin


Options Indexes FollowSymLinks
DirectoryIndex index.php


AddType application/x-httpd-php .php

php_flag magic_quotes_gpc Off
php_flag track_vars On
php_flag register_globals Off
php_value include_path .




# Authorize for setup


AuthType Basic
AuthName "phpMyAdmin Setup"
AuthUserFile /etc/phpmyadmin/htpasswd.setup

Require valid-user


# Disallow web access to directories that don't need it

Order Deny,Allow
Deny from All


Order Deny,Allow
Deny from All

Running the following command to enable the configuration:

sudo a2enconf phpmyadmin.conf

Step 4 – Restart Apache Server

Run the following command to restart apache web server on ubuntu 22.04:

sudo service apache2 restart

Step 5 – Login to PHPMyAdmin

Open your browser and type the below url with server ip:

http://[SERVER_PUBLIC_IP]/phpmyadmin

Conclusion

In this tutorial, i have shown to you how to install and configure PHPMyadmin on ubuntu 22.04 system.

More Tutorials

Leave a Comment