Sie möchten MariaDB (MySQL) auf Ihren Server installieren?

 

1. Server Paketliste aktualisieren

apt update && apt upgrade -y

 

2. MariaDB installieren

apt install ca-certificates apt-transport-https lsb-release gnupg curl nano unzip -y
apt install software-properties-common -y
add-apt-repository ppa:ondrej/php
apt update
apt install apache2 -y
apt install php8.2 php8.2-cli php8.2-common php8.2-curl php8.2-gd php8.2-intl php8.2-mbstring php8.2-mysql php8.2-opcache php8.2-readline php8.2-xml php8.2-xsl php8.2-zip php8.2-bz2 libapache2-mod-php8.2 -y
apt install mariadb-server mariadb-client -y
mysql_secure_installation
cd /usr/share
wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.zip -O phpmyadmin.zip
unzip phpmyadmin.zip
rm phpmyadmin.zip
mv phpMyAdmin-*-all-languages phpmyadmin
chmod -R 0755 phpmyadmin

 

3. Konfiguration editieren

nano /etc/apache2/conf-available/phpmyadmin.conf

!! Fügen Sie nun die untere Konfiguration ein !!

# phpMyAdmin Apache configuration

Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>
    Options SymLinksIfOwnerMatch
    DirectoryIndex index.php
</Directory>

# Disallow web access to directories that don't need it
<Directory /usr/share/phpmyadmin/templates>
    Require all denied
</Directory>
<Directory /usr/share/phpmyadmin/libraries>
    Require all denied
</Directory>
<Directory /usr/share/phpmyadmin/setup/lib>
    Require all denied
</Directory>

 

4. Aktivieren der Konfig

a2enconf phpmyadmin
systemctl reload apache2

 

5. Temporäres Verzeichnis erstellen

mkdir /usr/share/phpmyadmin/tmp/
chown -R www-data:www-data /usr/share/phpmyadmin/tmp/

 

6. Zusätzlichen Benutzer anlegen

mysql -u root
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *. * TO 'username'@'localhost' WITH GRANT OPTION
exit
War diese Antwort hilfreich? 1 Benutzer fanden dies hilfreich (1 Stimmen)