文档Experience Platform源连接器指南

使用Flow Service API将MySQL连接到Experience Platform

最近更新: 2025年5月21日
  • 主题:

创建对象:

  • 开发人员

阅读本指南,了解如何使用Flow Service API将您的MySQL帐户连接到Adobe Experience Platform。

快速入门

本指南要求您对 Adobe Experience Platform 的以下组件有一定了解:

  • 源: Experience Platform允许从各种源摄取数据,同时让您能够使用Experience Platform服务来构建、标记和增强传入数据。
  • 沙盒: Experience Platform提供了将单个Experience Platform实例划分为多个单独的虚拟环境的虚拟沙盒,以帮助开发和改进数字体验应用程序。

以下部分提供使用Flow Service API成功连接到MySQL所需了解的其他信息。

收集所需的凭据

有关身份验证的信息,请阅读MySQL 概述。

使用Experience Platform API

有关如何成功调用Experience Platform API的信息,请阅读Experience Platform API快速入门指南。

将MySQL连接到Azure上的Experience Platform

有关如何将您的MySQL帐户连接到Azure上的Experience Platform的信息,请阅读以下步骤。

在Azure上的Experience Platform上为MySQL创建基础连接

基本连接可将您的源链接到Experience Platform,以存储身份验证详细信息、连接状态和唯一ID。 使用此ID浏览源文件并标识要摄取的特定项目,包括其数据类型和格式。

API格式

POST /connections

要创建基本连接ID,请向/connections端点发出POST请求,并在请求参数中提供MySQL身份验证凭据。

基于连接字符串的身份验证

请求

以下请求使用基于连接字符串的身份验证为MySQL创建基本连接。

查看请求示例
curl -X POST \
  'https://platform.adobe.io/data/foundation/flowservice/connections' \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'x-sandbox-name: {SANDBOX_NAME}' \
  -H 'Content-Type: application/json' \
  -d '{
      "name": "MySQL Base Connection to Experience Platform",
      "description": "Via Connection String,
      "auth": {
          "specName": "Connection String Based Authentication",
          "params": {
              "connectionString": "Server={SERVER};Port={PORT};Database={DATABASE};UID={USERNAME};PWD={PASSWORD}"
          }
      },
      "connectionSpec": {
          "id": "26d738e0-8963-47ea-aadf-c60de735468a",
          "version": "1.0"
      }
  }'
属性
描述
auth.params.connectionString
与您的帐户关联的MySQL连接字符串。 MySQL连接字符串模式为: Server={SERVER};Port={PORT};Database={DATABASE};UID={USERNAME};PWD={PASSWORD}。
connectionSpec.id
MySQL连接规范ID: 26d738e0-8963-47ea-aadf-c60de735468a。

响应

成功的响应返回新创建的基本连接的详细信息,包括其唯一标识符(id)。

查看响应示例
{
    "id": "1a444165-3439-4c16-8441-653439dc166a",
    "etag": "\"5b04c219-0000-0200-0000-5e179c8f0000\""
}
基本身份验证

请求

以下请求使用基本身份验证为MySQL源创建基本连接。

查看请求示例
curl -X POST \
  'https://platform.adobe.io/data/foundation/flowservice/connections' \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'x-sandbox-name: {SANDBOX_NAME}' \
  -H 'Content-Type: application/json' \
  -d '{
      "name": "MySQL Base Connection to Experience Platform",
      "description": "Via Basic Authentication",
      "auth": {
          "specName": "Basic Authentication",
          "params": {
              "server": "localhost",
              "port": "443",
              "database": "mysql-acme",
              "username": "acme",
              "password": "xxxx",
              "sslMode": "DISABLED"
          }
      },
      "connectionSpec": {
          "id": "26d738e0-8963-47ea-aadf-c60de735468a",
          "version": "1.0"
      }
  }'
属性
描述
auth.params.server
MySQL数据库的名称或IP。
auth.params.database
数据库的名称。
auth.params.username
与数据库对应的用户名。
auth.params.password
与数据库对应的密码。
auth.params.sslMode
在数据传输期间对数据进行加密的方法。
connectionSpec.id
MySQL连接规范ID为: 26d738e0-8963-47ea-aadf-c60de735468a。

响应

成功的响应返回新创建的基本连接的详细信息,包括其唯一标识符(id)。

查看响应示例
{
    "id": "025d4158-4113-403b-b551-e81724d3880c",
    "etag": "\"ae004437-0000-0200-0000-67ee107e0000\""
}

将MySQL连接到Amazon Web Services上的Experience Platform

AVAILABILITY
本节适用于在Amazon Web Services (AWS)上运行的Experience Platform的实施。 在AWS上运行的Experience Platform当前仅对有限数量的客户可用。 要了解有关支持的Experience Platform基础架构的更多信息,请参阅Experience Platform multi-cloud概述。

有关如何将您的MySQL帐户连接到AWS上的Experience Platform的信息,请阅读以下步骤。

在AWS上的Experience Platform上为MySQL创建基本连接

API格式

POST /connections

请求

以下请求为MySQL创建基本连接以连接到AWS上的Experience Platform。

查看请求示例
curl -X POST \
  'https://platform.adobe.io/data/foundation/flowservice/connections' \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'x-api-key: {API_KEY}' \
  -H 'x-gw-ims-org-id: {ORG_ID}' \
  -H 'x-sandbox-name: {SANDBOX_NAME}' \
  -H 'Content-Type: application/json' \
  -d '{
      "name": "MySQL on Experience Platform AWS",
      "description": "MySQL on Experience Platform AWS",
      "auth": {
          "specName": "Basic Authentication",
          "params": {
              "server": "localhost",
              "port": "443",
              "database": "mysql-acme",
              "username": "acme",
              "password": "xxxx",
              "sslMode": "false"
          }
      },
      "connectionSpec": {
          "id": "26d738e0-8963-47ea-aadf-c60de735468a",
          "version": "1.0"
      }
  }'
属性
描述
auth.params.server
MySQL数据库的名称或IP。
auth.params.database
数据库的名称。
auth.params.username
与数据库对应的用户名。
auth.params.password
与数据库对应的密码。
auth.params.sslMode
一个布尔值,它控制是否强制使用SSL,具体取决于您的服务器支持。 此配置默认为false。
connectionSpec.id
MySQL连接规范ID为: 26d738e0-8963-47ea-aadf-c60de735468a。

响应

成功的响应返回新创建的基本连接的详细信息,包括其唯一标识符(id)。

查看响应示例
{
    "id": "f847950c-1c12-4568-a550-d5312b16fdb8",
    "etag": "\"0c0099f4-0000-0200-0000-67da91710000\""
}

为MySQL数据创建数据流

现在您已成功连接MySQL数据库,您现在可以创建数据流并将数据库中的数据摄取到Experience Platform。

recommendation-more-help
337b99bb-92fb-42ae-b6b7-c7042161d089