1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dotclear2_ynh.git synced 2024-09-03 18:26:29 +02:00

As initdb create db user, also removing it before db restoration

This commit is contained in:
Rémy Garrigue 2015-08-21 14:16:02 +00:00
parent 646556643b
commit f236f553e9

View file

@ -11,7 +11,7 @@ sudo cp -a $backup_dir/sources/. /var/www/$app
# Restore database # Restore database
root_pwd=$(sudo cat /etc/yunohost/mysql) root_pwd=$(sudo cat /etc/yunohost/mysql)
mysql -u root -p$root_pwd -e "DROP DATABASE $app ;" mysql -u root -p$root_pwd -e "DROP DATABASE $app ; DROP USER $app@localhost ;"
db_password=$(sudo yunohost app setting $app db_password) db_password=$(sudo yunohost app setting $app db_password)
sudo yunohost app initdb $app -p "$db_password" -s $backup_dir/dump.sql sudo yunohost app initdb $app -p "$db_password" -s $backup_dir/dump.sql