Install MariaDB and phpmyadmin

ref: https://phoenixnap.com/kb/how-to-install-phpmyadmin-on-debian

Install MarieDB:

sudo apt update
sudo apt install mariadb-server
sudo mysql_secure_installation

Enter current password for root (enter for none): (enter)
Switch to unix_socket authentication [Y/n] Y
Change the root password? [Y/n] n
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] n
Reload privilege tables now? [Y/n] y

Set root password for mariabd:
sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword';
flush privileges;
exit;

Try out mysql root login:
mysql -u root -p 

Install phpmyadmin

wget -P Downloads https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz
wget -P Downloads https://files.phpmyadmin.net/phpmyadmin.keyring
cd Downloads
gpg --import phpmyadmin.keyring
wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz.asc
gpg --verify phpMyAdmin-latest-all-languages.tar.gz.asc
sudo mkdir /var/www/html/phpMyAdmin
sudo tar xvf phpMyAdmin-latest-all-languages.tar.gz --strip-components=1 -C /var/www/html/phpMyAdmin
sudo cp /var/www/html/phpMyAdmin/config.sample.inc.php /var/www/html/phpMyAdmin/config.inc.php
sudo nano /var/www/html/phpMyAdmin/config.inc.php

Locate the following line:

$cfg['blowfish_secret'] = '';

Put in a password, and save and exit.

sudo apt -y install php php-cgi php-mysqli php-pear php-mbstring libapache2-mod-php php-common php-phpseclib php-mysql
sudo chmod 660 /var/www/html/phpMyAdmin/config.inc.php
sudo chown -R www-data:www-data /var/www/html/phpMyAdmin

sudo apt-get install libapache2-mod-php8.1
sudo a2enmod php8.1
sudo systemctl restart apache2

Go to your web browser and go to http://YOUR_VM_IP/phpMyAdmin


Scroll to Top