How to install PHPMyAdmin on Debian 9 Stretch

Debian Tutorial – Here we will show you how to install PHPMyAdmin on Debian 9 Stretch. PHPMyAdmin is a web based application to manage your MySQL Server. With PHPMyAdmin we can easily perform several administrative tasks to our MySQL or MariaDB Server such as create, edit, delete databases, users and also perform queries, export and import databases and many more. PHPMyAdmin can be easily installed on top of Debian 9 Stretch with LAMP Server installed on it. Please follow the following guide to install PHPMyAdmin on Debian.

Steps to install PHPMyAdmin on Debian 9 Stretch

  1. Install LAMP Server
  2. Install PHPMyAdmin
  3. Configure PHPMyAdmin

Step 1. Install LAMP Server on Debian 9

PHPMyAdmin needs a working web server. Please refers to our previous tutorial to install LAMP Server on Debian 9 Stretch.

Step 2. Install PHPMyAdmin

Use the following command to install PHPMyAdmin on Debian


During install process, you will need to configure the web server you are running. In my case, I use Apache.

And then select Yes to perform dbconfig-common to configure phpmyadmin with MySQL or MariaDB.

After the installation completed, you can try to open the PHPMySQL using web browser and type the IP address with the following format


And you should see something like this

Fix Login Error on PHPMyAdmin

Please skip this step if you have successfully login and use phpmyadmin on Debian 9 server. In some cases, we cannot login to phpmyadmin. Access denied for user ‘root’@’localhost’.

To fix this, make sure MariaDB Service is running. If stopped, start it.

Now we need to reconfigure PHPMyAdmin with this command below.

The phpmyadmin configuration wizard will open up. On the first screen, select Yes

Now select TCP/IP

Select localhost as the hostname

Specify the MySQL port.

Provide MySQL Database name for phpmyadmin

MySQL username for phpmyadmin. Make sure you only type ‘root’, not root@localhost.

Now specify root password

Specify the name of the database’s administrative user. This usually root.

Now refresh or re open phpmyadmin via browser and all should now works. Thank you for reading this how to install phpmyadmin on Debian 9 Stretch tutorial. See you next time.

1 Comment

Leave a Reply

Your email address will not be published.