Fixes #4720 Use mysql command to restore database instead of mysqldump

This commit is contained in:
James Tanner 2013-10-29 10:33:46 -04:00
parent 1a72cd4b0e
commit 3370aee870

View file

@ -129,13 +129,13 @@ def db_dump(module, host, user, password, db_name, target, socket=None):
return rc, stdout, stderr return rc, stdout, stderr
def db_import(module, host, user, password, db_name, target, socket=None): def db_import(module, host, user, password, db_name, target, socket=None):
cmd = module.get_bin_path('mysqldump', True) cmd = module.get_bin_path('mysql', True)
cmd += " --user=%s --password=%s" %(user, password) cmd += " --user=%s --password=%s" %(user, password)
if socket is not None: if socket is not None:
cmd += " --socket=%s" % socket cmd += " --socket=%s" % socket
else: else:
cmd += " --host=%s" % host cmd += " --host=%s" % host
cmd += " %s" % db_name cmd += " -D %s" % db_name
cmd += " < %s" % target cmd += " < %s" % target
rc, stdout, stderr = module.run_command(cmd) rc, stdout, stderr = module.run_command(cmd)
return rc, stdout, stderr return rc, stdout, stderr