mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
mysql_db: use --password= instead of -p in dump/import
This commit is contained in:
@@ -109,13 +109,13 @@ def db_delete(cursor, db):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def db_dump(host, user, password, db_name, target):
|
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+" > "
|
+db_name+" > "
|
||||||
+target)
|
+target)
|
||||||
return (res == 0)
|
return (res == 0)
|
||||||
|
|
||||||
def db_import(host, user, password, db_name, target):
|
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+" < "
|
+db_name+" < "
|
||||||
+target)
|
+target)
|
||||||
return (res == 0)
|
return (res == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user