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:
parent
646556643b
commit
f236f553e9
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue