• May 31, 2023

How to Install phpMyAdmin on Ubuntu in 5 Easy Steps!

by Flexadia 1 year ago in Linux
How to Install phpMyAdmin on Ubuntu in 5 Easy Steps!

How to Install phpMyAdmin on Ubuntu in 5 Easy Steps!

How to Install phpMyAdmin on Ubuntu – phpMyAdmin is a web-based application used to manage MySQL databases. If you are using an Ubuntu VPS, you should know how to install phpMyAdmin on Ubuntu.

Then, how to install phpMyAdmin on Ubuntu? Let’s see the explanation below!

How to Install phpMyAdmin on Ubuntu

Here are five steps on how to install phpMyAdmin on Ubuntu. Let’s see them one by one:

1. Update Server

First of all, you need to update the repository on Ubuntu by using the following command:

# sudo apt-get update

2. Install Apache

Next, install Apache on Ubuntu using the following command:

# sudo apt-get install apache2

After the Apache install process is complete, you need to check whether the installation was successful or not. You can check it by opening your server IP like this:

http://your-IP-server

If it appears like the image below, it means that the Apache installation process has been successful.

How to Install phpMyAdmin on Ubuntu in 5 Easy Steps!

3. Install MySQL

Then you have to install MySQL which works to manage SQL databases. To start the installation process, enter the following command:

# sudo apt-get install mysql-server

After the MySQL installation process is complete, you can check the success of the installation by logging into MySQL using the following command:

# mysql -u root -p

Next, you will be asked for a password to log in to MySQL. If you haven’t set a password for MySQL, just press ENTER to continue.

If you are successful in logging into MySQL, an image like this will appear:

How to Install phpMyAdmin on Ubuntu in 5 Easy Steps!

To exit MySQL, you can enter the exit command and press ENTER:

mysql> exit;

4. Install PHP

Next is the PHP installation process. To install PHP, you can enter the following command:

# sudo apt-get install php php-mysql libapache2-mod-php php-cli php-cgi php-gd mysql-server mysql-client zip -y

To make sure the PHP installation process is successful, you can check with the following three steps:

4.1. Enter the HTML Directory

Go to the HTML directory on the webserver using the following command:

# cd /var/www/html

4. 2. Create PHP Info File

Next, create a PHP file using the following command:

# touch info.php

4.3. Go to PHP Info File

When finished creating the PHP info file, go to the PHP info file using the following command:

# nano info.php

How to Install phpMyAdmin on Ubuntu in 5 Easy Steps!

Then enter the code below by copying and pasting it using a right-click:

<?php

phpinfo();

?>

How to Install phpMyAdmin on Ubuntu in 5 Easy Steps!

Then save by clicking CTRL + X then press y and ENTER.

4.4. Access Server IP

If the PHP info file has been added, enter the following command in your web browser to check whether the PHP installation was successful or not.

http://your-IP-Server/info.php

How to Install phpMyAdmin on Ubuntu in 5 Easy Steps!

The image above is an image of the PHP version information installed on your web server. If the display above appears, it means that your PHP installation was successful.

5. Install phpMyAdmin

After installing all the supporting applications, you can now install phpMyAdmin. To start the installation process, enter the following command:

# sudo apt-get install phpmyadmin

After that, you will be asked to select the type of web server. The default choice is apache2. Press ENTER to select. Then press the Tab key to move to the OK button. Press the ENTER button to continue.

How to Install phpMyAdmin on Ubuntu in 5 Easy Steps!

Next, you will be asked if you want to configure the database for phpMyAdmin with dbconfig-common. Select Yes and click ENTER.

How to Install phpMyAdmin on Ubuntu in 5 Easy Steps!

Then you will be asked to create a new password for the phpMyAdmin login.

How to Install phpMyAdmin on Ubuntu in 5 Easy Steps!

Finally, confirm the password. Make sure the password is the same as the one you entered earlier.

How to Install phpMyAdmin on Ubuntu in 5 Easy Steps!

To ensure that the phpMyAdmin installation process is successful, open your website URL in the following format:

http://your-IP-Server/phpmyadmin

How to Install phpMyAdmin on Ubuntu in 5 Easy Steps!

If the display above appears, the phpMyAdmin installation process has been successful. To log in to phpMyAdmin, you can enter the root username and password that you created during the phpMyAdmin installation process. If the login is successful, you will be directed to a page like the one below.

How to Install phpMyAdmin on Ubuntu in 5 Easy Steps!