Using SSL with SQLAlchemy

前端 未结 3 1825
梦毁少年i
梦毁少年i 2021-02-13 04:42

I\'ve recently changed my project to use SQLAlchemy and my project runs fine, it used an external MySQL server.

Now I\'m trying to work with a different MySQL server wit

3条回答
  •  名媛妹妹
    2021-02-13 05:08

    I changed the DBAPI to MySQL-Connector, and used the following code:

    ssl_args = {'ssl_ca': ca_path}
    engine = create_engine("mysql+mysqlconnector://:@/",
                            connect_args=ssl_args)
    

    And now it works.

提交回复
热议问题