python fabric mysql privileges
问题 Trying to set mysql user privileges with fabric. run("mysql -u %s -p%s -e 'grant all on %s.* to '%s'@'localhost' identified by 'PASSWORD'" % (user, dbpasswd, account)) Error TypeError: not enough arguments for format string Any idea ? Thanks a lot ! run('mysql -u %s -p%s -e "grant all on %s.* to '%s\'@\'localhost' identified by 'PASSWORD'"' % (user, dbpasswd, account, account)) SyntaxError: unexpected character after line continuation character 回答1: Change your tuple to (user, dbpasswd,