fix format strings
This commit is contained in:
parent
ff83795916
commit
4ed81c29e6
1 changed files with 4 additions and 4 deletions
|
@ -39,7 +39,7 @@ def create_mysql_user(username, password):
|
||||||
curs = conn.cursor()
|
curs = conn.cursor()
|
||||||
curs.execute(
|
curs.execute(
|
||||||
"""
|
"""
|
||||||
CREATE USER %(username)s@'%' IDENTIFIED BY %(password)s
|
CREATE USER %(username)s@'%%' IDENTIFIED BY %(password)s
|
||||||
""",
|
""",
|
||||||
{'username': username, 'password': password}
|
{'username': username, 'password': password}
|
||||||
)
|
)
|
||||||
|
@ -83,7 +83,7 @@ def delete_mysql_user(username):
|
||||||
curs = conn.cursor()
|
curs = conn.cursor()
|
||||||
curs.execute(
|
curs.execute(
|
||||||
"""
|
"""
|
||||||
DROP USER %(username)s@'%'
|
DROP USER %(username)s@'%%'
|
||||||
""",
|
""",
|
||||||
{'username': username})
|
{'username': username})
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
@ -110,7 +110,7 @@ def create_mysql_database(dbname, username):
|
||||||
{'dbname': dbname})
|
{'dbname': dbname})
|
||||||
curs.execute(
|
curs.execute(
|
||||||
"""
|
"""
|
||||||
GRANT ALL PRIVILEGES ON %(dbname)s.* TO %(username)s@'%'
|
GRANT ALL PRIVILEGES ON %(dbname)s.* TO %(username)s@'%%'
|
||||||
""",
|
""",
|
||||||
{'dbname': dbname, 'username': username})
|
{'dbname': dbname, 'username': username})
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
@ -133,7 +133,7 @@ def delete_mysql_database(dbname, username):
|
||||||
curs = conn.cursor()
|
curs = conn.cursor()
|
||||||
curs.execute(
|
curs.execute(
|
||||||
"""
|
"""
|
||||||
REVOKE ALL PRIVILEGES ON %(dbname)s.* FROM %(username)s@'%'
|
REVOKE ALL PRIVILEGES ON %(dbname)s.* FROM %(username)s@'%%'
|
||||||
""",
|
""",
|
||||||
{'dbname': dbname, 'username': username})
|
{'dbname': dbname, 'username': username})
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
|
Loading…
Reference in a new issue