directus db 7

This commit is contained in:
Valentin 2024-02-23 18:21:53 +01:00
parent cd788805f7
commit a90a73e9a9
1 changed files with 6 additions and 8 deletions

View File

@ -153,16 +153,14 @@ if [[ "$answer" == "y" ]]; then
fi
install_expect
CREATE_DIRECTUS_DB=$(expect -c "
spawn mariadb -u root -p
spawn mysql -u root -p <<EOF
CREATE USER 'directus'@'localhost' IDENTIFIED BY '${db_directus_password}';
CREATE DATABASE directus;
GRANT ALL PRIVILEGES ON directus.* TO 'directus'@'localhost' IDENTIFIED BY '${db_directus_password}';
FLUSH PRIVILEGES;
EOF
expect \"Enter password:\"
send \"$db_root_password\r\"
expect \"mysql>\"
send \"CREATE USER 'directus'@'localhost' IDENTIFIED BY '${db_directus_password}';\r\"
send \"CREATE DATABASE directus;\r\"
send \"GRANT ALL PRIVILEGES ON directus.* TO 'directus'@'localhost' IDENTIFIED BY '${db_directus_password}';\r\"
send \"FLUSH PRIVILEGES;\r\"
expect \"mysql>\"
send \"quit;\r\"
")
echo "${CREATE_DIRECTUS_DB}"
fi