Fix MySQL commands (#225)

This commit is contained in:
Franck Nijhof 2024-12-07 15:32:49 +01:00 committed by GitHub
parent 9a989d7015
commit cda68af41d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

3
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,3 @@
{
"todo-tree.tree.scanMode": "workspace"
}

View file

@ -24,17 +24,19 @@ port=$(bashio::services "mysql" "port")
username=$(bashio::services "mysql" "username")
database=$(\
mysql \
mariadb \
-u "${username}" -p"${password}" \
-h "${host}" -P "${port}" \
--skip-column-names \
--skip-ssl \
-e "SHOW DATABASES LIKE 'phpmyadmin';"
)
if ! bashio::var.has_value "${database}"; then
bashio::log.info "Creating database for phpMyAdmin"
mysql \
mariadb \
-u "${username}" -p"${password}" \
-h "${host}" -P "${port}" \
--skip-ssl \
< /var/www/phpmyadmin/sql/create_tables.sql
fi