Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions spiceaidocs/docs/data-connectors/mysql.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: 'MySQL Data Connector'
sidebar_label: 'MySQL Data Connector'
description: 'MySQL Data Connector Documentation'
---

## Federated SQL query

To connect to any MySQL database as connector for federated SQL query, specify `mysql` as the selector in the `from` value for the dataset.

```yaml
datasets:
- from: mysql:path.to.my_dataset
name: my_dataset
```

## Configuration

The connection to MySQL: can be configured by providing the following `params`:

- `mysql_connection_string`: The connection string to use to connect to the MySQL server. This can be used instead of providing individual connection parameters.
- `mysql_connection_string_key`: The secret key containing the connection string to use to connect to the MySQL server. This can be used instead of providing individual connection parameters.
- `mysql_host`: The hostname of the MySQL server.
- `mysql_port`: The port of the MySQL server.
- `mysql_db`: The name of the database to connect to.
- `mysql_user`: The username to connect with.
- `mysql_pass_key`: The secret key containing the password to connect with.
- `mysql_pass`: The raw password to connect with, ignored if `mysql_pass_key` is provided.
- `mysql_sslmode`: Optional parameter, specifies the SSL/TLS behavior for the connection, supported values:
- `required`: (default) This mode requires an SSL connection. If a secure connection cannot be established, server will not connect.
- `preferred`: This mode will try to establish a secure SSL connection if possible, but will connect insecurely if the server does not support SSL.
- `disabled`: This mode will not attempt to use an SSL connection, even if the server supports it.

Configuration `params` are provided either in the top level `dataset` for a dataset source and federated SQL query.

```yaml
datasets:
- from: mysql:path.to.my_dataset
name: my_dataset
params:
mysql_host: localhost
mysql_port: '3306'
mysql_db: my_database
mysql_user: my_user
mysql_pass_key: my_secret
```
1 change: 1 addition & 0 deletions spiceaidocs/docs/reference/spicepod/datasets.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Where:
- `databricks`
- `s3`
- `postgres`
- `mysql`

If the source is not specified, it defaults to `spiceai`.

Expand Down