简体   繁体   中英

change user's privileges on mysql using sqlalchemy

Hi I need to create an user in mysql using sqlalchemy: I am able to check the existence of the user before creating it and create it if it does not exist but when i try to gran t all the privileges on the db I get this error
e TypeError: not enough arguments for format string thos are the instructions that I use:
TypeError: not enough arguments for format string thos are the instructions that I use:
self.engine.execute("CREATE USER 'metmi' IDENTIFIED BY 'metmi'")`

and

`self.engine.execute("GRANT ALL PRIVILEGES ON *.* TO metmi@'\%' IDENTIFIED BY  'metmi'")`

if I use the same instruction on phpMyadmin or on the mysql prompt it works, so I am really puzzled, do not know what is wrong; can somebody tell me what is my error? thankls in advance

我解决了我必须在本地主机上创建同一用户的Mysql内部过程

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM