Skip to content

Commit

Permalink
fix unset variable in helper 2.1 mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
kay0u committed Dec 9, 2024
1 parent e992bd1 commit ca73596
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions helpers/helpers.v2.1.d/mysql
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ ynh_mysql_db_shell() {
local default_character_set=""
if [[ -n "$database" ]]; then
default_character_set=$(mysql -B $database <<< 'show variables like "character_set_database";' | tail -n1 | cut -f2)
default_character_set="--default-character-set=$character_set"
default_character_set="--default-character-set=$default_character_set"
fi

mysql $character_set -B $database
mysql $default_character_set -B $database
}

# Create a database and grant optionnaly privilegies to a user
Expand Down Expand Up @@ -93,7 +93,7 @@ ynh_mysql_dump_db() {
local default_character_set=""
if [[ -n "$database" ]]; then
default_character_set=$(mysql -B $database <<< 'show variables like "character_set_database";' | tail -n1 | cut -f2)
default_character_set="--default-character-set=$character_set"
default_character_set="--default-character-set=$default_character_set"
fi

mysqldump $default_character_set --single-transaction --skip-dump-date --routines "$database"
Expand Down

0 comments on commit ca73596

Please sign in to comment.