Would you like to learn how to install PhpMyAdmin on a computer running Ubuntu Linux? In this tutorial, we are going to install and configure PhpMyAdmin using the Apache server on a computer running Ubuntu Linux.

• Ubuntu 18
• Ubuntu 19
• Ubuntu 20
• Apache 2.4.41
• PhpMyAdmin 4.9.5

Equipment list

The following section presents the list of equipment used to create this tutorial.

As an Amazon Associate, I earn from qualifying purchases.

Tutorial PhpMyAdmin – MySQL installation

Install the MySQL database service.

Copy to Clipboard

Access the MySQL service command-line.

Copy to Clipboard

Set a password to the MySQL root user.

Copy to Clipboard

In our example, we set the Mysql password: Kamisama123

Try to access the MySQL service using the new password.

Copy to Clipboard

Create a database named phpmyadmin.

Copy to Clipboard

Create a Mysql user account named PMA

Copy to Clipboard

In our example, we set the Mysql password: Kamisama123

Grant the PMA user account permission over the database named PHPMYADMIN.

Copy to Clipboard

Download the PhpMyAdmin installation package.

Copy to Clipboard

Import the PhpMyAdmin’s database template using the account named PMA.

Copy to Clipboard

You have finished the PhpMyAdmin database installation.

Tutorial PhpMyAdmin – Apache installation

Install the Apache web server and all the required packages.

Copy to Clipboard

Enable the Apache module named: Mod_rewrite

Copy to Clipboard

Edit the Apache configuration file.

Copy to Clipboard

Add the following lines at the end of this file.

Copy to Clipboard

Enable the PHP support on Apache.

Copy to Clipboard

Find the location of the PHP configuration file on your system.

Edit the configuration file named: PHP.INI.

Copy to Clipboard

Your PHP version may not be the same as ours.

Your PHP configuration file location may not be the same as ours.

Enable and configure the following items of the PHP configuration file.

Copy to Clipboard

Set the correct timezone to your location.

Restart the apache service.

Copy to Clipboard

You have finished the Apache service installation with PHP support.

Tutorial PhpMyAdmin – Installation on Ubuntu

Move the PhpMyAdmin directory to the Apache root directory.

Copy to Clipboard

Create the list of required directories.

Copy to Clipboard

Set the correct permissions.

Copy to Clipboard

Create the PhpMyAdmin’s configuration file.

Copy to Clipboard

Edit the configuration file.

Copy to Clipboard

Enable and configure the following items of the configuration file.

Copy to Clipboard

Use the following command to generate the random key used on the parameter named: BLOWFISH_SECRET

Copy to Clipboard

Open your browser and enter the IP address of your web server plus /phpmyadmin.

In our example, the following URL was entered in the Browser:

• http://172.31.8.195/phpmyadmin

The PhpMyAdmin login screen will be displayed.

On the Login screen, enter the MySQL’s ROOT account information.

PhpMyAdmin Login

After a successful login, The PhpMyAdmin dashboard will be displayed.

PhpMyAdmin Dashboard

Congratulations! You have finished the installation of PhpMyAdmin.

Tutorial PhpMyAdmin – Basic authentication

The PhpMyAdmin software provides a direct interface to the MySQL service.

We are going to configure an extra layer of authentication to protect the initial access to PhpMyAdmin.

Create the password file and add the first user account.

Copy to Clipboard

The system will request you to enter the password to the new user account.

Copy to Clipboard

Here is the file content.

Copy to Clipboard

To create additional user accounts, use the following command.

Copy to Clipboard

Edit the Apache configuration file for the default website.

Copy to Clipboard

Insert the following line in the area named: VirtualHost.

Copy to Clipboard

Here is the file content.

Copy to Clipboard

Restart the Apache service.

Copy to Clipboard

Open your browser and enter the IP address of your web server plus /phpmyadmin.

In our example, the following URL was entered in the Browser:

• http://172.31.8.195/phpmyadmin

The Apache server will require you to perform the user authentication.

Nginx authentication

After a successful login, The PhpMyAdmin login screen will be presented.

PhpMyAdmin Login

After a successful login, The PhpMyAdmin dashboard will be displayed.

PhpMyAdmin Dashboard

Congratulations! You have finished the installation of PhpMyAdmin.