Jelajahi Sumber

fix witten reported mysql error

Divyansh Singh 2 tahun lalu
induk
melakukan
e53dd3da87
1 mengubah file dengan 3 tambahan dan 3 penghapusan
  1. 3 3
      borgmatic/hooks/mysql.py

+ 3 - 3
borgmatic/hooks/mysql.py

@@ -216,10 +216,10 @@ def restore_database_dump(
     restore_command = (
     restore_command = (
         ('mysql', '--batch')
         ('mysql', '--batch')
         + (tuple(database['restore_options'].split(' ')) if 'restore_options' in database else ())
         + (tuple(database['restore_options'].split(' ')) if 'restore_options' in database else ())
-        + (('--host', database['hostname']) if hostname else ())
-        + (('--port', str(database['port'])) if port else ())
+        + (('--host', hostname) if hostname else ())
+        + (('--port', str(port)) if port else ())
         + (('--protocol', 'tcp') if hostname or port else ())
         + (('--protocol', 'tcp') if hostname or port else ())
-        + (('--user', database['username']) if username else ())
+        + (('--user', username) if username else ())
     )
     )
     extra_environment = {'MYSQL_PWD': password} if password else None
     extra_environment = {'MYSQL_PWD': password} if password else None