1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #2558 from jochu/mysql-password

mysql_db: use --password= instead of -p in dump/import
This commit is contained in:
Michael DeHaan 2013-04-05 10:50:35 -07:00
commit f7a53d24e7

View file

@ -109,13 +109,13 @@ def db_delete(cursor, db):
return True
def db_dump(host, user, password, db_name, target):
res = os.system("/usr/bin/mysqldump -q -h "+host+"-u "+user+ " -p"+password+" "
res = os.system("/usr/bin/mysqldump -q -h "+host+"-u "+user+ " --password="+password+" "
+db_name+" > "
+target)
return (res == 0)
def db_import(host, user, password, db_name, target):
res = os.system("/usr/bin/mysql -h "+host+" -u "+user+ " -p"+password+" "
res = os.system("/usr/bin/mysql -h "+host+" -u "+user+" --password="+password+" "
+db_name+" < "
+target)
return (res == 0)