mysql登录路径文件读取器
myloginpath的Python项目详细描述
mysql的登录路径文件读取器
解密并解析mysql的登录路径文件。
另请参见:https://dev.mysql.com/doc/refman/8.0/en/mysql-config-editor.html
示例
$ mysql_config_editor set --login-path=client --host=localhost --user=localuser --password Enter password: <Type password here>
importmyloginpath,MySQLdbconf=myloginpath.parse('client')print(conf)# {'host': 'localhost', 'user': 'localuser', 'password': 'secretstring'}conn=MySQLdb.connect(**conf,db="myapp")