gpt4 book ai didi

ssl - 如何通过 SSL 连接使用 Alembic?

转载 作者:太空宇宙 更新时间:2023-11-03 14:37:33 24 4
gpt4 key购买 nike

我使用 Alembic 来管理我的迁移。我的数据库在 AWS 上,我想用 SSL 连接它。

在我的 alembic.ini 中有几行

[production]
script_location = alembic_prod
sqlalchemy.url = mysql+pymysql://user:password@my-rds-host.eu-west-1.rds.amazonaws.com/mydatabase

当然,如果 user 有权限在没有 SSL 的情况下连接基地,它就可以工作,否则就不行。

如何要求 SSL 连接,并指定 certificate

最佳答案

您首先需要证书包 -

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_MySQL.html#MySQL.Concepts.SSLSupport

然后您可以将适当的参数添加到您的 URL 中,如下所示 -

How to connect to mysql server with SSL from a flask app

关于ssl - 如何通过 SSL 连接使用 Alembic?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46317055/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com