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

# MariaDB

> Sync schema and tabular data from a MariaDB database into PipesHub

<div className="max-w-2xl mx-auto mt-12">
  <div className="p-6 border border-gray-200 dark:border-gray-700 rounded-lg bg-amber-50 dark:bg-gray-800">
    <div className="flex items-center mb-4">
      <img src="https://mintcdn.com/pipeshub/j8n3yMqJ2bbn6Vp0/logo/mariadb.png?fit=max&auto=format&n=j8n3yMqJ2bbn6Vp0&q=85&s=10073c75b97ba284c5f33faa927a592a" alt="MariaDB Logo" className="w-8 h-8 mr-3 object-contain flex-shrink-0" width="770" height="512" data-path="logo/mariadb.png" />

      <h2 className="text-2xl font-semibold m-0">MariaDB</h2>
    </div>

    <p className="text-lg text-gray-700 dark:text-gray-300 mb-4">Tables sync from a MariaDB database</p>

    <div className="flex items-center gap-2">
      <span className="px-3 py-1 bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200 rounded-full text-sm font-medium">
        Ready
      </span>

      <span className="px-3 py-1 bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded-full text-sm font-medium">
        Database
      </span>
    </div>
  </div>
</div>

## Overview

The MariaDB connector indexes schema metadata, table contents from a MariaDB database so your AI assistant can answer questions over structured data alongside your other knowledge sources.

<Note>
  Looking for query execution from agents (run SQL on demand, no indexing)? Use the [MariaDB Toolset](/toolsets/mariadb/mariadb) instead. Connector = sync & search. Toolset = run actions.
</Note>

### What Gets Synced

| Content Type | Details                                                                        |
| ------------ | ------------------------------------------------------------------------------ |
| **Tables**   | Table names, columns, data types, primary and foreign keys                     |
| **Row data** | Row contents from selected tables, capped per table by the **Max rows** filter |

***

## Configuration Guide

<AccordionGroup>
  <Accordion title="Step 1: Set up MariaDB" icon="database">
    If you already have a MariaDB server, skip this step.

    ### Option A: Docker (recommended for testing)

    Run a local MariaDB container:

    ```bash theme={null}
    docker run --name mariadb-test \
      -e MARIADB_ROOT_PASSWORD=rootpass \
      -e MARIADB_DATABASE=test_db \
      -p 3306:3306 \
      -d mariadb:latest
    ```

    This starts MariaDB on `localhost:3306` with:

    * Username: `root`
    * Password: `rootpass`
    * Database: `test_db`

    ### Option B: Install locally

    Install MariaDB from the [official MariaDB downloads page](https://mariadb.org/download/) and follow the installer for your OS. After install, start the server and note your `host`, `port`, `username`, and `password`.

    ### Verify the connection

    ```bash theme={null}
    mysql -h localhost -P 3306 -u root -p
    ```

    Enter your password when prompted. If you reach the `MariaDB [(none)]>` prompt, the server is ready.

    ### Create a user for the connector

    Create a dedicated read-only user for PipesHub. Run these as `root` (or any user with `CREATE USER` and `GRANT` privileges) against the target database:

    ```sql theme={null}
    CREATE USER 'pipeshub_user'@'%' IDENTIFIED BY 'a_strong_password';
    GRANT SELECT ON test_db.* TO 'pipeshub_user'@'%';
    FLUSH PRIVILEGES;
    ```

    The connector also reads schema metadata from `information_schema`, which is available to any authenticated user by default.

    <Info>
      Replace `pipeshub_user`, `a_strong_password`, and `test_db` with your own values. Use `'pipeshub_user'@'localhost'` instead of `'%'` if PipesHub connects from the same host as the database.
    </Info>
  </Accordion>

  <Accordion title="Step 2: Configure the connector in PipesHub" icon="plug">
    1. In PipesHub, open **Connector Settings**.
    2. In the **Available** tab, find the **MariaDB** card and click **Configure**.

    <div className="text-center">
      <img src="https://mintcdn.com/pipeshub/txCd87-IKPyEuUDz/images/connectors/mariadb/mariadb-connector-card.png?fit=max&auto=format&n=txCd87-IKPyEuUDz&q=85&s=145fe57379727f8753a25d8c793c1dd2" alt="MariaDB connector card in Available connectors" className="block mx-auto w-11/12" width="1906" height="914" data-path="images/connectors/mariadb/mariadb-connector-card.png" />
    </div>

    3. Fill in the connection details:

    | Field        | Example                                     |
    | ------------ | ------------------------------------------- |
    | **Host**     | `localhost`                                 |
    | **Port**     | `3306`                                      |
    | **Database** | `test_db`                                   |
    | **User**     | `pipeshub_user`                             |
    | **Password** | the password you set when creating the user |

    <div className="text-center">
      <img src="https://mintcdn.com/pipeshub/txCd87-IKPyEuUDz/images/connectors/mariadb/mariadb-auth-config.png?fit=max&auto=format&n=txCd87-IKPyEuUDz&q=85&s=c3db39c5b826e5471ed341101f73b886" alt="MariaDB connector auth configuration" className="block mx-auto w-11/12" width="1905" height="899" data-path="images/connectors/mariadb/mariadb-auth-config.png" />
    </div>
  </Accordion>

  <Accordion title="Step 3: Configure sync filters" icon="filter">
    Sync filters control what is pulled from MariaDB. Anything excluded by a filter is never downloaded.

    <div className="text-center">
      <img src="https://mintcdn.com/pipeshub/txCd87-IKPyEuUDz/images/connectors/mariadb/mariadb-sync-filters.png?fit=max&auto=format&n=txCd87-IKPyEuUDz&q=85&s=aff414d1cc484a5cad71b2018516e9be" alt="MariaDB sync filters" className="block mx-auto w-11/12" width="1914" height="902" data-path="images/connectors/mariadb/mariadb-sync-filters.png" />
    </div>

    | Filter                 | Description                                                                                           | Default    |
    | ---------------------- | ----------------------------------------------------------------------------------------------------- | ---------- |
    | **Tables**             | Pick the tables to sync (e.g. `customers`, `orders`). Leave empty to sync all tables in the database. | All tables |
    | **Max rows per table** | Maximum number of rows to fetch from each table.                                                      | 1000       |
    | **Index tables**       | When enabled, table content is indexed for AI search. When disabled, only schema metadata is indexed. | Enabled    |

    <Info>
      Use **Max rows per table** to keep initial syncs fast on large tables, or to cap the amount of data exposed to your assistant.
    </Info>
  </Accordion>

  <Accordion title="Step 4: Choose a sync strategy and save" icon="rotate">
    1. Pick **Scheduled** or **Manual** sync.
    2. If scheduled, set the **Sync interval** (default: 60 minutes).
    3. Click **Save** to enable the connector.

    <div className="text-center">
      <img src="https://mintcdn.com/pipeshub/txCd87-IKPyEuUDz/images/connectors/mariadb/mariadb-sync-settings.png?fit=max&auto=format&n=txCd87-IKPyEuUDz&q=85&s=35eded5f4680e384013f6018ceb9f561" alt="MariaDB sync settings" className="block mx-auto w-11/12" width="1899" height="903" data-path="images/connectors/mariadb/mariadb-sync-settings.png" />
    </div>

    The connector verifies the connection, then runs the initial sync. Watch the **Indexing Progress** to track completion.

    <div className="text-center">
      <img src="https://mintcdn.com/pipeshub/txCd87-IKPyEuUDz/images/connectors/mariadb/mariadb-connector-active.png?fit=max&auto=format&n=txCd87-IKPyEuUDz&q=85&s=ac5e013268d21f6ee0fc49452a19cbb2" alt="MariaDB connector active and synced" className="block mx-auto w-11/12" width="1896" height="907" data-path="images/connectors/mariadb/mariadb-connector-active.png" />
    </div>
  </Accordion>
</AccordionGroup>

***

## FAQ

<AccordionGroup>
  <Accordion title="What privileges does the MariaDB user need?">
    For read-only sync, `SELECT` on the target database is enough:

    ```sql theme={null}
    GRANT SELECT ON test_db.* TO 'pipeshub_user'@'%';
    ```

    The connector also reads schema metadata from `information_schema`, which is available to any authenticated user by default.
  </Accordion>

  <Accordion title="Can I connect to a remote MariaDB server?">
    Yes. Use the public host and port of your MariaDB server. Make sure the server allows connections from the PipesHub deployment and that the user has the required privileges.
  </Accordion>

  <Accordion title="How do I keep large tables from blowing up the sync?">
    Use **Max rows per table** in sync filters to cap how many rows are fetched per table, and use the **Tables** filter to only sync the tables you actually need.
  </Accordion>

  <Accordion title="What's the difference between this connector and the MariaDB toolset?">
    * **Connector** indexes your table and rows so they can be searched alongside your other knowledge.
    * **Toolset** lets agents run live SQL against MariaDB at query time without indexing.

    You can use both together — the connector for fast retrieval and the toolset when an agent needs to run a fresh query.
  </Accordion>
</AccordionGroup>
