MySQL/MariaDB: fix create user with password (#4918)

* MySQL/MariaDB: Fix Authentification with password

* add apache guac

* harmonize $STD value
This commit is contained in:
CanbiZ
2025-06-02 13:11:41 +02:00
committed by GitHub
parent 824fd22aae
commit b4a58b907f
19 changed files with 37 additions and 37 deletions

View File

@ -28,7 +28,7 @@ DB_NAME=phpipam
DB_USER=phpipam
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
$STD mariadb -u root -e "CREATE DATABASE $DB_NAME;"
$STD mariadb -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');"
$STD mariadb -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';"
$STD mariadb -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
{
echo "phpIPAM-Credentials"
@ -43,7 +43,7 @@ RELEASE=$(curl -fsSL https://api.github.com/repos/phpipam/phpipam/releases/lates
cd /opt
curl -fsSL "https://github.com/phpipam/phpipam/releases/download/v${RELEASE}/phpipam-v${RELEASE}.zip" -o "phpipam-v${RELEASE}.zip"
$STD unzip "phpipam-v${RELEASE}.zip"
mariadb -u root "${DB_NAME}" </opt/phpipam/db/SCHEMA.sql
$STD mariadb -u root "${DB_NAME}" </opt/phpipam/db/SCHEMA.sql
cp /opt/phpipam/config.dist.php /opt/phpipam/config.php
sed -i -e "s/\(\$disable_installer = \).*/\1true;/" \
-e "s/\(\$db\['user'\] = \).*/\1'$DB_USER';/" \