How to connect to mysql server with SSL from a flask app
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to connect to a mysql server via flask and app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://your-username:your-password@localhost/schema' How can I add ca-cert, client-key and client-cert to the connection? 回答1: You can add theses informations in your URI like this : app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://your-username:your-password@localhost/schema?ssl_key=MyCertFolder/client-key.pem&ssl_cert=MyCertFolder/client-cert.pem' Or using the SQLAlchemy create_engine, take a look to this post 文章来源: How to connect to mysql server