Hey,
In this post I will explain you how to install a MySQL database and PHPMyAdmin.
We start directly:
## Install MySQL database server & client
apt install mysql-server mysql-client
# Customize MySQL security settings
mysql_secure_installation
# Set up admin user
mysql -u root
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'herePassword';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;
=================================
## Install PHPMyAdmin
DATA="$(wget https://www.phpmyadmin.net/home_page/version.txt -q -O-)"
URL="$(echo $DATA | cut -d ' ' -f 3)"
VERSION="$(echo $DATA | cut -d ' ' -f 1)"
wget https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.gz
# Unpack tar archive (filename could be different)
tar xvf phpMyAdmin-5.0.2-all-languages.tar.gz
mv phpMyAdmin-*/ /usr/share/phpmyadmin
# Create temp folder and assign permissions
mkdir -p /var/lib/phpmyadmin/tmp
chown -R www-data:www-data /var/lib/phpmyadmin
# Copy PHPMyAdmin configuration file
cp /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php
# In the configuration adjust the following /usr/share/phpmyadmin/config.inc.php:
$cfg['blowfish_secret'] = 'HereMakeAnExtremelyLongTextWithDifferentCharactersSoThisIsSafe';
$cfg['TempDir'] = '/var/lib/phpmyadmin/tmp';
# Assign rights again
chown -R www-data:www-data /var/lib/phpmyadmin
# Now configure Nginx on /usr/share/phpmyadmin
# For this purpose, the complete configuration file is given here as a spoiler
=================================
I hope you could install such a database and PHPMyAdmin successfully!