我有这个简单的代码:
cmd = ["mysqldump", "-u Dmitriy", "-pMyPass", "dmitrii"]
p = subprocess.Popen(cmd, stdout = file)
如果我尝试执行它 - 我收到一个错误:
mysqldump: Got error: 1045: Access denied for user ' Dmitriy'@'localhost' (using password: YES
when trying to connect.
如果我将此()复制粘贴mysqldump -u Dmitriy -pMyPass dmitrii
到命令行-一切正常。
任何建议为什么会发生这种情况?