
## Set up CrateDB

URL: https://docs.atlan.com/apps/connectors/database/cratedb/how-tos/set-up-cratedb

> Configure authentication and connection settings for CrateDB connector

This guide provides steps to set up a dedicated database user and configure permissions to enable Atlan to securely connect to your CrateDB cluster and extract metadata for data discovery and governance.

## Prerequisites

Before you begin, make sure you have:
* Administrative access to your CrateDB cluster
* Network connectivity between Atlan and your CrateDB instance
* Your CrateDB cluster's HTTP endpoint and port information

## Permission required

Before setting up the CrateDB connector, you need:

* Administrative access to your CrateDB cluster to create users and grant permissions
* To run the setup statements for each schema you want to crawl

## Create database user

Create a dedicated database user with the necessary permissions for Atlan to access your CrateDB cluster securely.

1. Create a dedicated user for Atlan with basic authentication:

 ```sql
 CREATE USER atlan_user WITH (password = '<password>');
 ```

 - Replace `<password>` with a secure password for the `atlan_user`.

2. Grant DQL permissions on the target schema:

 ```sql
 GRANT DQL ON SCHEMA <schema> TO atlan_user;
 ```

 - Replace `<schema>` with the schema to which the user needs access.

3. Grant DQL permissions on system schemas for metadata access:

 ```sql
 GRANT DQL ON SCHEMA information_schema TO atlan_user;
 GRANT DQL ON SCHEMA sys TO atlan_user;
 ```

## Configure authentication

Choose the authentication method that best fits your security requirements and infrastructure setup.

### Basic authentication

To create a username and password for basic authentication:

```sql
CREATE USER atlan_user WITH (password = '<password>');
GRANT DQL ON SCHEMA <schema> TO atlan_user;
```

- Replace `<password>` with the password for the `atlan_user` user you are creating.

### Certificate-based authentication

Certificate-based authentication is available for Enterprise customers.

## Grant permissions

Grant the necessary permissions to enable Atlan to access metadata and data from your CrateDB cluster.

:::warning Important
DQL permissions grant both metadata access and data read access. CrateDB doesn't support metadata-only access.
:::

* **System schema permissions**: Grant DQL permissions on system schemas for metadata access:

 ```sql
 GRANT DQL ON SCHEMA information_schema TO atlan_user;
 GRANT DQL ON SCHEMA sys TO atlan_user;
 ```

 These system schemas contain CrateDB metadata:
 - `information_schema`: Standard SQL metadata tables
 - `sys`: CrateDB-specific system tables for cluster and table information

* **Data access permissions**: Grant DQL permissions on user schemas for data preview and querying:

 ```sql
 GRANT DQL ON TABLE <schema>.* TO atlan_user;
 ```

 - Replace `<schema>` with the name of the schema you want Atlan to access.

## Configure connection

To connect Atlan to your CrateDB cluster, you’ll need to provide the following details during setup:

* **Host**: The HTTP endpoint of your CrateDB cluster. For example, `https://your-cluster.crate.io`
* **Username**: The database username created in the [Create database user](#create-database-user) section.
* **Password**: The secure password set for the database user created in the [Create database user](#create-database-user) section.
* **Database**: The name of the CrateDB database to crawl. Enter the specific database for metadata extraction.

## Troubleshooting

If you encounter connection or authentication issues, see [Connection issues](https://docs.atlan.com/llms/connectors/cratedb/connection-issues/llms.txt).

## Next steps

* [Crawl CrateDB](https://docs.atlan.com/llms/connectors/cratedb/crawl-cratedb/llms.txt) - Extract metadata from your CrateDB instance

---
