mirror of
https://github.com/frappe/frappe_docker.git
synced 2025-01-23 23:28:27 +00:00
Merge pull request #222 from revant/fix-restore-backup
fix: restore backup grant privileges command
This commit is contained in:
commit
b6b8afe415
@ -78,17 +78,11 @@ def restore_database(files_base, site):
|
||||
)
|
||||
os.system(create_user)
|
||||
|
||||
# create user password
|
||||
set_user_password = mysql_command + "\"ALTER USER '{db_name}'@'%' IDENTIFIED BY '{db_password}'; FLUSH PRIVILEGES;\"".format(
|
||||
# grant db privileges to user
|
||||
grant_privileges = mysql_command + "\"GRANT ALL PRIVILEGES ON \`{db_name}\`.* TO '{db_name}'@'%' IDENTIFIED BY '{db_password}'; FLUSH PRIVILEGES;\"".format(
|
||||
db_name=site_config.get('db_name'),
|
||||
db_password=site_config.get('db_password')
|
||||
)
|
||||
os.system(set_user_password)
|
||||
|
||||
# grant db privileges to user
|
||||
grant_privileges = mysql_command + "\"GRANT ALL PRIVILEGES ON \`{db_name}\`.* TO '{db_name}'@'%'; FLUSH PRIVILEGES;\"".format(
|
||||
db_name=site_config.get('db_name')
|
||||
)
|
||||
os.system(grant_privileges)
|
||||
|
||||
command = "mysql -u{db_root_user} -h{db_host} -p{db_password} '{db_name}' < {database_file}".format(
|
||||
|
Loading…
x
Reference in New Issue
Block a user