Modify MySQL commands to skip SSL requirement

Added --skip-ssl option to MySQL commands for database creation and user alteration.

https://github.com/alexbelgium/hassio-addons/issues/2113#issuecomment-3315292129
This commit is contained in:
Alexandre
2025-09-21 07:19:09 +02:00
committed by GitHub
parent 05a6c55447
commit 95d2702eef

View File

@@ -105,11 +105,20 @@ case $(bashio::config 'DB_CONNECTION') in
bashio::log.warning "Uninstalling the MariaDB addon will remove any data"
bashio::log.info "Creating database for Firefly-iii if required"
# Create database without SSL requirement
mysql \
-u "${DB_USERNAME}" -p"${DB_PASSWORD}" \
-h "${DB_HOST}" -P "${DB_PORT}" \
-e "CREATE DATABASE IF NOT EXISTS \`firefly\` ;"
;;
--skip-ssl \
-u "${DB_USERNAME}" -p"${DB_PASSWORD}" \
-h "${DB_HOST}" -P "${DB_PORT}" \
-e "CREATE DATABASE IF NOT EXISTS \`firefly\`;"
# Ensure the user does not require SSL
mysql \
--skip-ssl \
-u "${DB_USERNAME}" -p"${DB_PASSWORD}" \
-h "${DB_HOST}" -P "${DB_PORT}" \
-e "ALTER USER '${DB_USERNAME}'@'%' REQUIRE NONE;"
;;
# Use remote
*)