diff --git a/scripts/change_url b/scripts/change_url index 1b12f70..b1fb7a3 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -31,6 +31,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) # Add settings here as needed by your application #db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#db_user=$db_name #db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) #================================================= diff --git a/scripts/install b/scripts/install index 22d2000..b5fc2a9 100755 --- a/scripts/install +++ b/scripts/install @@ -123,8 +123,9 @@ ynh_script_progression --message="Creating a MySQL database..." --time --weight= ### - As well as the section "RESTORE THE MYSQL DATABASE" in the restore script db_name=$(ynh_sanitize_dbid $app) +db_user=$db_name ynh_app_setting_set --app=$app --key=db_name --value=$db_name -ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name +ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE diff --git a/scripts/restore b/scripts/restore index 0a0a24f..9553993 100755 --- a/scripts/restore +++ b/scripts/restore @@ -32,6 +32,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$db_name #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -104,8 +105,8 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Restoring the MySQL database..." --time --weight=1 db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name --db_pwd=$db_pwd -ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ./db.sql +ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd +ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql #================================================= # RESTORE SYSTEMD