How to make mysql connection that requires CA-CERT with sqlalchemy or SQLObject

后端 未结 4 1429
刺人心
刺人心 2020-12-05 19:38

I would like to connect to a MySQL database that requires ca-cert. I can do it with MySQLdb like below:

MySQLdb.connect(host = self.host,
                po         


        
4条回答
  •  感动是毒
    2020-12-05 20:17

    SQLObject (untested):

    from sqlobject.mysql import MySQLConnection
    connection = MySQLConnection(
        db=self.db,
        user=self.user,
        password=self.password,
        host=self.host,
        ssl_key=self.sslkey,
        ssl_cert=self.sslcert,
        ssl_ca=self.sslca,
    )
    

提交回复
热议问题