Installing PHPMyAdmin on Ubuntu: A Step-by-Step Guide

Introduction:

PHPMyAdmin is a powerful web-based tool that provides a graphical interface for managing MySQL and MariaDB databases. This guide will walk you through the process of installing PHPMyAdmin on an Ubuntu system, ensuring that you can easily manage your databases with a user-friendly interface.

Step 1: Install Apache, MySQL, and PHP:

Before installing PHPMyAdmin, make sure to install the necessary components – Apache, MySQL, and PHP. Open a terminal and run the following commands:

sudo apt update 
sudo apt install apache2 mysql-server php libapache2-mod-php php-mysql

During the installation, you may be prompted to confirm; press “y” to proceed.

Step 2: Secure MySQL:

Run the MySQL security script to set up essential security measures:

sudo mysql_secure_installation

Follow the on-screen prompts to set a root password and implement other security configurations.

Step 3: Install PHPMyAdmin:

Use the following command to install PHPMyAdmin:

sudo apt install phpmyadmin

During the installation, you’ll be presented with some options. Choose Apache by pressing the spacebar and then hit “Enter” to continue.

Step 4: Configure Apache:

Edit the apache2.conf file to enable PHPMyAdmin with Apache:

sudo nano /etc/apache2/apache2.conf

Add the following line at the end of the file:

Include /etc/phpmyadmin/apache.conf

Save and exit the file, then restart Apache:

sudo systemctl restart apache2

Step 5: Access PHPMyAdmin in a Web Browser:

Open your web browser and navigate to http://localhost/phpmyadmin. You can now log in using the MySQL root username and password.

Congratulations! You have successfully installed PHPMyAdmin on your Ubuntu system, providing an easy-to-use interface for managing your MySQL databases.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.