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
- Install LAMP Server
- Install PHPMyAdmin
- 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
apt install phpmyadmin
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.
root@debian-vm:/etc/phpmyadmin# systemctl status mariadb ● mariadb.service - MariaDB database server Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2017-08-09 12:31:44 WITA; 8min ago Main PID: 30049 (mysqld) Status: "Taking your SQL requests now..." Tasks: 28 (limit: 4915) CGroup: /system.slice/mariadb.service └─30049 /usr/sbin/mysqld Aug 09 12:31:43 debian-vm systemd: Starting MariaDB database server... Aug 09 12:31:43 debian-vm mysqld: 2017-08-09 12:31:43 139641452937792 [Note] /usr/sbin/mysqld (mysqld 10.1.23-MariaDB-9 Aug 09 12:31:44 debian-vm systemd: Started MariaDB database server.
Now we need to reconfigure PHPMyAdmin with this command below.
dpkg-reconfigure -plow phpmyadmin
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.