mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-15 13:21:50 +02:00
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:
@@ -105,11 +105,20 @@ case $(bashio::config 'DB_CONNECTION') in
|
|||||||
bashio::log.warning "Uninstalling the MariaDB addon will remove any data"
|
bashio::log.warning "Uninstalling the MariaDB addon will remove any data"
|
||||||
|
|
||||||
bashio::log.info "Creating database for Firefly-iii if required"
|
bashio::log.info "Creating database for Firefly-iii if required"
|
||||||
|
# Create database without SSL requirement
|
||||||
mysql \
|
mysql \
|
||||||
-u "${DB_USERNAME}" -p"${DB_PASSWORD}" \
|
--skip-ssl \
|
||||||
-h "${DB_HOST}" -P "${DB_PORT}" \
|
-u "${DB_USERNAME}" -p"${DB_PASSWORD}" \
|
||||||
-e "CREATE DATABASE IF NOT EXISTS \`firefly\` ;"
|
-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
|
# Use remote
|
||||||
*)
|
*)
|
||||||
|
|||||||
Reference in New Issue
Block a user