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
root@debian-vm:/home/dhani# apt install phpmyadmin
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
php-bz2 php-pear php-php-gettext php-phpseclib php-tcpdf php7.0-bz2
php-libsodium php-gmp php5-imagick www-browser
The following NEW packages will be installed:
php-bz2 php-pear php-php-gettext php-phpseclib php-tcpdf php7.0-bz2 phpmyadmin
0 upgraded, 13 newly installed, 0 to remove and 0 not upgraded.
Need to get 13.2 MB of archives.
After this operation, 51.0 MB of additional disk space will be used.
Do you want to continue? [Y/n]
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)
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.