Installation PHPMYADMIN
Installation PHPMYADMIN
Pour cette installation, un serveur sous Debian 11 est utilisé
PREREQUIS
Installation Apache 2
# apt install -y apache2
# systemctl enable apache2
# apt install -y apache2-utils
Vérifier la version installée avec apache2ctl -v
Installation PHP 7.4
# apt install -y php7.4
# apt install -y php-pdo php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath
Installation Mysql 8
# wget https://repo.mysql.com//mysql-apt-config_0.8.22-1_all.deb
# dpkg -i mysql-apt-config_0.8.22-1_all.deb
# apt update
# apt install mysql-server
INSTALLATION PHPMYADMIN
Récupérer la version voulu sur https://www.phpmyadmin.net/files/
Installation PHPMYADMIN
# cd /tmp
# wget https://files.phpmyadmin.net/phpMyAdmin/5.1.3/phpMyAdmin-5.1.3-all-languages.zip
# unzip phpMyAdmin-5.1.3-all-languages.zip
# mv phpMyAdmin-5.1.3-all-languages /usr/share/phpmyadmin
# mkdir -p /var/lib/phpmyadmin/tmp (création d'un dossier tmp dédié)
Donner les droits au dossier phpmyadmin à l'utilisateur associé à Apache (www-data)
# chown -R www-data:www-data /var/lib/phpmyadmin/
Configuration PHPMYADMIN
# cp /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php
# Ajouter sa config dans le fichier /usr/share/phpmyadmin/config.inc.php
# Décommenter les lignes suivantes et ajouter l'user et le mdp qui seront utilisés par phpmyadmin pour se connecter à sa base
$cfg['Servers'][$i]['controluser'] = 'pmagekko'; $cfg['Servers'][$i]['controlpass'] = 'Password';
Generic
Création DB de PHPMYADMIN
# mysql -u root -p < /usr/share/phpmyadmin/sql/create_tables.sql
Création user PHPMYADMIN défini précédemment dans le fichier de config
CREATE USER 'pmagekko'@'localhost' IDENTIFIED BY 'Password'; GRANT ALL PRIVILEGES ON phpmyadmin.* TO 'pmagekko'@'localhost' WITH GRANT OPTION; FLUSH PRIVILEGES;
Generic
Création user admin pouvant accéder aux différentes bases
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'Password2'; GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION; FLUSH PRIVILEGES;
Generic
Configuration Apache
# nano /etc/apache2/conf-available/phpmyadmin.conf -> Mettre la config voulue
# systemctl reload apache2
# a2enconf phpmyadmin.conf
# apachectl configtest
En cas d'erreur "AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message"
Ajouter la ligne ServerName 127.0.0.1 au fichier /etc/apache2/apache2.conf
# systemctl reload apache2
Inspiré de cette doc https://www.it-connect.fr/installer-phpmyadmin-sur-debian-11-et-apache/