# SQL

**How to connect SQL to Churned**\
Log in to the Churned platform and go to the “Integrations” section. Click on “New Integration” and select SQL from the list.

You will be prompted to enter the following credentials:

Required Credentials

* host – The address of your SQL database server.
* port – The port your SQL server listens on (e.g., 3306 for MySQL, 5432 for PostgreSQL).
* username – The user authorized to access the database.
* password – The password for the database user.
* database – The name of the database you want to connect.

Here’s how you can obtain these credentials:

1. Ask your database administrator for the host, port, and login credentials.
2. Make sure the database user has read access to the necessary tables.
3. Identify the database name that contains your customer data.

Input the Credentials\
Paste the host, port, username, password, and database name into the Churned integration form.

Click Save to test the connection. Once it’s working, notify the Churned team to begin syncing data.

Helpful Links

* [PostgreSQL Documentation](https://www.postgresql.org/docs/)
* [MySQL Documentation](https://dev.mysql.com/doc/)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.churned.io/churned-docs/integrations/sql.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
