In this article, we will have explained the necessary steps to install and configure phpMyAdmin on Debian 10. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.
phpMyAdmin is an open-source, web-based administration tool for managing the MySQL and MariaDB database. It is written in PHP and is one of the most popular database administration tools used by web hosting companies to enable novice system administrators to carry out database activities.
Install phpMyAdmin on Debian
Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.
sudo apt update sudo apt upgrade
Step 2. Install LAMP stack on Debian.
It is assumed that you have already installed LAMP stack on Debian 10. If not, please check out the following tutorial.
Step 3. Install phpMyAdmin.
Now install phpMyAdmin by typing following command in the terminal:
sudo apt install phpmyadmin php-mbstring php-gettext
First, you will need to select apache as web server. Select Apache and click OK.
Now enter the following command to enable php-mbstring extension:
sudo phpenmod php-mbstring
Restart apache2 using following command:
sudo systemctl restart apache2
Step 4. Configure phpMyAdmin.
Apache configuration file will be created at /etc/phpmyadmin/apache.conf. You can edit configuration file:
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-enabled/phpmyadmin.conf sudo a2enconf phpmyadmin
Then, restart Apache service:
sudo systemctl restart apache2
Step 5. Create Database User.
First, open MySQL shell by typing following command:
sudo mysql
Create a new user by typing following command:
CREATE USER 'user_name'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON *.* TO 'user_name'@'localhost' WITH GRANT OPTION; exit;
Now you can login with created users credentials and access phpMyAdmin:
Congratulation, you have learned how to install and configure phpMyAdmin on Debian 10 Buster. If you have any question, please leave a comment below.