> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flextable.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect to a database

> How to connect FlexTable to PostgreSQL, MySQL, SQLite, MongoDB, Redis, and more engines as they land.

Every engine uses the same flow: **+ New Connection -> pick a type -> fill the form -> Test -> Save**, with fields that match that engine. New databases follow the same flow as they are added.

<img src="https://mintcdn.com/flextable/N9AmtdFPRmv5ROOo/images/02-connecting/type-picker.png?fit=max&auto=format&n=N9AmtdFPRmv5ROOo&q=85&s=cf14bfec89ac7daa71f7c18e68f0ec2d" alt="Connection type picker" width="670" height="515" data-path="images/02-connecting/type-picker.png" />

<Tip>The **Test** button validates your credentials and reachability before you save. A green **Connected** badge means you are good to go.</Tip>

<Tabs>
  <Tab title="PostgreSQL">
    | Field           | Notes                                         |
    | --------------- | --------------------------------------------- |
    | Host / Port     | e.g. `localhost` / `5432`                     |
    | Database        | the default database to open                  |
    | User / Password | always required                               |
    | SSL             | see [Secure connections](/secure-connections) |

    <img src="https://mintcdn.com/flextable/N9AmtdFPRmv5ROOo/images/02-connecting/postgres.png?fit=max&auto=format&n=N9AmtdFPRmv5ROOo&q=85&s=ee9e97c2268a11be9c6bcd980a7cae51" alt="PostgreSQL form" width="671" height="513" data-path="images/02-connecting/postgres.png" />
  </Tab>

  <Tab title="MySQL / MariaDB">
    | Field           | Notes                               |
    | --------------- | ----------------------------------- |
    | Host / Port     | e.g. `localhost` / `3306`           |
    | Database        | optional, leave blank to browse all |
    | User / Password | required                            |

    <img src="https://mintcdn.com/flextable/N9AmtdFPRmv5ROOo/images/02-connecting/mysql.png?fit=max&auto=format&n=N9AmtdFPRmv5ROOo&q=85&s=080119b7f6d55fbf8dbc883f74135e8e" alt="MySQL form" width="674" height="516" data-path="images/02-connecting/mysql.png" />
  </Tab>

  <Tab title="SQLite">
    SQLite is file-based, so there is no host, port, or credentials.

    <Steps>
      <Step title="Choose SQLite">Pick SQLite as the type.</Step>
      <Step title="Select the file">Click **Browse** and choose your `.db` or `.sqlite` file.</Step>
      <Step title="Save">The database opens in the sidebar.</Step>
    </Steps>

    <img src="https://mintcdn.com/flextable/N9AmtdFPRmv5ROOo/images/02-connecting/sqlite.png?fit=max&auto=format&n=N9AmtdFPRmv5ROOo&q=85&s=67dacf243b5f67df84678b16ab851e8d" alt="SQLite file picker" width="674" height="521" data-path="images/02-connecting/sqlite.png" />
  </Tab>

  <Tab title="MongoDB">
    | Field                 | Notes                                          |
    | --------------------- | ---------------------------------------------- |
    | Connection string     | `mongodb://...` or `mongodb+srv://...` (Atlas) |
    | Or host / port / auth | enter the components individually              |
    | Database              | optional                                       |

    <img src="https://mintcdn.com/flextable/N9AmtdFPRmv5ROOo/images/02-connecting/mongodb.png?fit=max&auto=format&n=N9AmtdFPRmv5ROOo&q=85&s=fc354c1d7aa19d78a98c502938a70b50" alt="MongoDB form" width="674" height="516" data-path="images/02-connecting/mongodb.png" />
  </Tab>

  <Tab title="Redis">
    Redis auth varies by version: no auth (local/dev), password only (Redis \< 6), or username + password (Redis 6+ ACL).

    | Field          | Notes                     |
    | -------------- | ------------------------- |
    | Host / Port    | e.g. `localhost` / `6379` |
    | Username       | optional (ACL)            |
    | Password       | optional                  |
    | Database index | `0`-`15`                  |

    <img src="https://mintcdn.com/flextable/N9AmtdFPRmv5ROOo/images/02-connecting/redis.png?fit=max&auto=format&n=N9AmtdFPRmv5ROOo&q=85&s=3f730b39821b65fa39ec0a454863c2cc" alt="Redis form" width="674" height="520" data-path="images/02-connecting/redis.png" />
  </Tab>
</Tabs>

## Next steps

<CardGroup cols={2}>
  <Card title="Secure connections" icon="lock" href="/secure-connections">SSL/TLS, SSH tunnel, and AWS RDS IAM auth.</Card>
  <Card title="Manage connections" icon="folder-tree" href="/managing-connections">Organize connections into folders and favorites.</Card>
</CardGroup>
