Problems using MySQL with AWS Lambda in Python

后端 未结 9 1109
南方客
南方客 2020-12-05 17:43

I am trying to get up and running with AWS Lambda Python (beginner in Python btw) but having some problems with including MySQL dependency. I am trying to follow the instruc

9条回答
  •  庸人自扰
    2020-12-05 18:32

    Just update your lambda layer by uploading two packages: - sqlalchemy - PyMySQL (driver to use instead of mysqlclient)

    Now update your driver url to "mysql+pymysql://...".

    This makes you use pymysql driver which is compatible with Lambda environment for your existing environments.

    Don't forget to set VPC endpoint for RDS. This keeps performance and security in check.

提交回复
热议问题