directus db 8

This commit is contained in:
Valentin 2024-02-23 18:26:16 +01:00
parent a90a73e9a9
commit c32965a4d6
1 changed files with 10 additions and 6 deletions

View File

@ -153,14 +153,18 @@ if [[ "$answer" == "y" ]]; then
fi
install_expect
CREATE_DIRECTUS_DB=$(expect -c "
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
spawn
mariadb -u root -p
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\"
expect eof
")
echo "${CREATE_DIRECTUS_DB}"
fi