diff --git a/helpers/mysql b/helpers/mysql index 94179f2fd..e4bcb42f6 100644 --- a/helpers/mysql +++ b/helpers/mysql @@ -136,13 +136,15 @@ ynh_mysql_drop_db() { # Requires YunoHost version 2.2.4 or higher. ynh_mysql_dump_db() { # Declare an array to define the options of this helper. - local legacy_args=d - local -A args_array=([d]=database=) + local legacy_args=dc + local -A args_array=( [d]=database= [c]=default_character_set= ) local database + local default_character_set # Manage arguments with getopts ynh_handle_getopts_args "$@" + default_character_set="${default_character_set:-latin1}" - mysqldump --single-transaction --skip-dump-date --routines "$database" + mysqldump --single-transaction --skip-dump-date --routines --default-character-set=$default_character_set "$database" } # Create a user