我使用 Alembic 来管理我的迁移。我的数据库位于 AWS 上,我想使用 SSL 连接它。
在我的 alembic.ini
中,我有以下几行
[production]
script_location = alembic_prod
sqlalchemy.url = mysql+pymysql://user:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="93e3f2e0e0e4fce1f7d3feeabee1f7e0befbfce0e7bdf6e6bee4f6e0e7bea2bde1f7e0bdf2fef2e9fcfdf2e4e0bdf0fcfe" rel="noreferrer noopener nofollow">[email protected]</a>/mydatabase
当然,如果用户
有权在不使用 SSL 的情况下连接底座,则可以使用,否则不行。
如何要求 SSL 连接,并指定 certificate ?
最佳答案
您首先需要证书 bundle -
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_MySQL.html#MySQL.Concepts.SSLSupport
然后,您可以将适当的参数添加到您的 URL,如下所示 -
关于ssl - 如何通过 SSL 连接使用 Alembic?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46317055/