Help Center/ FunctionGraph/ User Guide (Ally Region)/ FAQs/ External Resource Access FAQs/ How Does a Function Access the MySQL Database?
Updated on 2026-01-09 GMT+08:00

How Does a Function Access the MySQL Database?

Perform the following operations:

  1. Check whether the MySQL database is deployed in a VPC.
  2. Search for MySQL templates and select the one with the desired runtime. Set the parameters as required and click Create Function.
  3. After the MySQL function is created, choose Configuration > Environment Variables, click Edit Environment Variable. In the displayed dialog box, add environment variables and enable encryption as required, and click OK.

    If the function needs to access RDS APIs, create an agency and grant required permissions.