# MySQL — Pipedream Connect

> MySQL is an open-source relational database management system.

- API slug: `mysql` (use in MCP headers and tool keys)
- Auth: API key (Pipedream-managed)
- Categories: Databases
- Website: https://www.mysql.com/
- This page (HTML): https://pipedream.com/apps/mysql
- Tools: 10 actions · 5 triggers

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: mysql`

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "mysql",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// e.g. run Execute SQL Query:
const result = await mcp.callTool({
  name: "mysql-execute-raw-query",
  arguments: {
    sql: "SQL Query",
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## SDK

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "mysql-execute-raw-query",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    mysql: { authProvisionId: "apn_xxxxxxx" },
    sql: "SQL Query",
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (10)

### `mysql-execute-raw-query` — Execute SQL Query (Write)

Execute a custom MySQL query. See our docs to learn more about working with SQL in Pipedream.

Full schema: https://pipedream.com/apps/mysql/actions/execute-raw-query.md

### `mysql-create-row` — Create Row (Write)

Adds a new row. See the docs here

Full schema: https://pipedream.com/apps/mysql/actions/create-row.md

### `mysql-delete-row` — Delete Row (Write)

Delete an existing row. See the docs here

Full schema: https://pipedream.com/apps/mysql/actions/delete-row.md

### `mysql-execute-query` — Execute Query (Read-only)

Find row(s) via a custom query. See the docs here

Full schema: https://pipedream.com/apps/mysql/actions/execute-query.md

### `mysql-execute-stored-procedure` — Execute Stored Procedure (Write)

Execute Stored Procedure. See the docs here

Full schema: https://pipedream.com/apps/mysql/actions/execute-stored-procedure.md

### `mysql-find-row` — Find Row (Read-only)

Finds a row in a table via a lookup column. See the docs here

Full schema: https://pipedream.com/apps/mysql/actions/find-row.md

### `mysql-list-stored-procedure-options` — List Stored Procedure Options (Read-only)

Retrieves available options for the Stored Procedure field.

Full schema: https://pipedream.com/apps/mysql/actions/list-stored-procedure-options.md

### `mysql-list-table-options` — List Table Options (Read-only)

Retrieves available options for the Table field.

Full schema: https://pipedream.com/apps/mysql/actions/list-table-options.md

### `database-query-sql-database` — Query SQL Database (Write)

Execute a SQL Query. See our docs to learn more about working with SQL in Pipedream.

Full schema: https://pipedream.com/apps/mysql/actions/database-query-sql-database.md

### `mysql-update-row` — Update Row (Write)

Updates an existing row. See the docs here

Full schema: https://pipedream.com/apps/mysql/actions/update-row.md

## Triggers (5)

### `mysql-new-column` — New Column (Polling)

Emit new event when you add a new column to a table. See the docs here

Full schema: https://pipedream.com/apps/mysql/triggers/new-column.md

### `mysql-new-or-updated-row` — New or Updated Row (Polling)

Emit new event when you add or modify a new row in a table. See the docs here

Full schema: https://pipedream.com/apps/mysql/triggers/new-or-updated-row.md

### `mysql-new-row` — New Row (Polling)

Emit new event when you add a new row to a table. See the docs here

Full schema: https://pipedream.com/apps/mysql/triggers/new-row.md

### `mysql-new-row-custom-query` — New Row (Custom Query) (Polling)

Emit new event when new rows are returned from a custom query. See the docs here

Full schema: https://pipedream.com/apps/mysql/triggers/new-row-custom-query.md

### `mysql-new-table` — New Table (Polling)

Emit new event when a new table is added to a database. See the docs here

Full schema: https://pipedream.com/apps/mysql/triggers/new-table.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
