> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-fbfa8bee.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Amazon QuickSight powers data-driven organizations with unified business intelligence (BI).

# QuickSight

export const ClickHouseSupportedBadge = () => {
  return <div className="ClickHouseSupportedBadge">
            <div className="ClickHouseSupportedIcon">
                <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
                    <path d="M1.30762 1.39073C1.30762 1.3103 1.37465 1.22986 1.46849 1.22986H2.64824C2.72868 1.22986 2.80912 1.29689 2.80912 1.39073V14.4886C2.80912 14.5691 2.74209 14.6495 2.64824 14.6495H1.46849C1.38805 14.6495 1.30762 14.5825 1.30762 14.4886V1.39073Z" fill="currentColor" />
                    <path d="M4.2832 1.39073C4.2832 1.3103 4.35023 1.22986 4.44408 1.22986H5.62383C5.70427 1.22986 5.7847 1.29689 5.7847 1.39073V14.4886C5.7847 14.5691 5.71767 14.6495 5.62383 14.6495H4.44408C4.36364 14.6495 4.2832 14.5825 4.2832 14.4886V1.39073Z" fill="currentColor" />
                    <path d="M7.25977 1.39073C7.25977 1.3103 7.3268 1.22986 7.42064 1.22986H8.60039C8.68083 1.22986 8.76127 1.29689 8.76127 1.39073V14.4886C8.76127 14.5691 8.69423 14.6495 8.60039 14.6495H7.42064C7.3402 14.6495 7.25977 14.5825 7.25977 14.4886V1.39073Z" fill="currentColor" />
                    <path d="M10.2354 1.39073C10.2354 1.3103 10.3024 1.22986 10.3962 1.22986H11.576C11.6564 1.22986 11.7369 1.29689 11.7369 1.39073V14.4886C11.7369 14.5691 11.6698 14.6495 11.576 14.6495H10.3962C10.3158 14.6495 10.2354 14.5825 10.2354 14.4886V1.39073Z" fill="currentColor" />
                    <path d="M13.2256 6.6057C13.2256 6.52526 13.2926 6.44482 13.3865 6.44482H14.5662C14.6466 6.44482 14.7271 6.51186 14.7271 6.6057V9.27354C14.7271 9.35398 14.6601 9.43442 14.5662 9.43442H13.3865C13.306 9.43442 13.2256 9.36739 13.2256 9.27354V6.6057Z" fill="currentColor" />
                </svg>
            </div>
            ClickHouse Supported
        </div>;
};

export const Image = ({img, alt, size}) => {
  return <Frame>
      <img src={img} alt={alt} />
    </Frame>;
};

QuickSight can connect to on-premise ClickHouse setup (23.11+) via MySQL interface using the official MySQL data source and Direct Query mode.

<h2 id="on-premise-clickhouse-server-setup">
  On-premise ClickHouse server setup
</h2>

Please refer to [the official documentation](/concepts/features/interfaces/mysql) on how to set up a ClickHouse server with enabled MySQL interface.

Aside from adding an entry to the server's `config.xml`

```xml theme={null}
<clickhouse>
    <mysql_port>9004</mysql_port>
</clickhouse>
```

it is also *required* to use [Double SHA1 password encryption](/concepts/features/configuration/settings/settings-users#user-namepassword) for the user that will be using MySQL interface.

Generating a random password encrypted with Double SHA1 from the shell:

```shell theme={null}
PASSWORD=$(base64 < /dev/urandom | head -c16); echo "$PASSWORD"; echo -n "$PASSWORD" | sha1sum | tr -d '-' | xxd -r -p | sha1sum | tr -d '-'
```

The output should look like the following:

```text theme={null}
LZOQYnqQN4L/T6L0
fbc958cc745a82188a51f30de69eebfc67c40ee4
```

The first line is the generated password, and the second line is the hash we could use to configure ClickHouse.

Here is an example configuration for `mysql_user` that uses the generated hash:

`/etc/clickhouse-server/users.d/mysql_user.xml`

```xml theme={null}
<users>
    <mysql_user>
        <password_double_sha1_hex>fbc958cc745a82188a51f30de69eebfc67c40ee4</password_double_sha1_hex>
        <networks>
            <ip>::/0</ip>
        </networks>
        <profile>default</profile>
        <quota>default</quota>
    </mysql_user>
</users>
```

Replace `password_double_sha1_hex` entry with your own generated Double SHA1 hash.

QuickSight requires several additional settings in the MySQL user's profile.

`/etc/clickhouse-server/users.d/mysql_user.xml`

```xml theme={null}
<profiles>
    <default>
        <prefer_column_name_to_alias>1</prefer_column_name_to_alias>
        <mysql_map_string_to_text_in_show_columns>1</mysql_map_string_to_text_in_show_columns>
        <mysql_map_fixed_string_to_text_in_show_columns>1</mysql_map_fixed_string_to_text_in_show_columns>
    </default>
</profiles>
```

However, it is recommended to assign it to a different profile that can be used by your MySQL user instead of the default one.

Finally, configure the Clickhouse Server to listen on the desired IP address(es).
In `config.xml`, uncomment out the following to listen on all addresses:

```bash theme={null}
<listen_host>::</listen_host>
```

If you have the `mysql` binary available, you can test the connection from the command line.
Using the sample username (`mysql_user`) and password (`LZOQYnqQN4L/T6L0`) from above the command line would be:

```bash theme={null}
mysql --protocol tcp -h localhost -u mysql_user -P 9004 --password=LZOQYnqQN4L/T6L0
```

```response theme={null}
mysql> show databases;
+--------------------+
| name               |
+--------------------+
| INFORMATION_SCHEMA |
| default            |
| information_schema |
| system             |
+--------------------+
4 rows in set (0.00 sec)
Read 4 rows, 603.00 B in 0.00156 sec., 2564 rows/sec., 377.48 KiB/sec.
```

<h2 id="connecting-quicksight-to-clickhouse">
  Connecting QuickSight to ClickHouse
</h2>

First of all, go to [https://quicksight.aws.amazon.com](https://quicksight.aws.amazon.com), navigate to Datasets and click "New dataset":

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/m3SFJgFQv2eos7Pa/images/integrations/data-visualization/quicksight_01.png?fit=max&auto=format&n=m3SFJgFQv2eos7Pa&q=85&s=7955e5432d0bdf8b4c6e9c001370a5f6" alt="Amazon QuickSight dashboard showing the New dataset button in Datasets section" border width="1555" height="1038" data-path="images/integrations/data-visualization/quicksight_01.png" />

<br />

Search for the official MySQL connector bundled with QuickSight (named just **MySQL**):

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/m3SFJgFQv2eos7Pa/images/integrations/data-visualization/quicksight_02.png?fit=max&auto=format&n=m3SFJgFQv2eos7Pa&q=85&s=1427cda51a1caff1a50e7f73a08bc39d" alt="QuickSight data source selection screen with MySQL highlighted in search results" border width="2006" height="1040" data-path="images/integrations/data-visualization/quicksight_02.png" />

<br />

Specify your connection details. Please note that MySQL interface port is 9004 by default,
and it might be different depending on your server configuration.

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/m3SFJgFQv2eos7Pa/images/integrations/data-visualization/quicksight_03.png?fit=max&auto=format&n=m3SFJgFQv2eos7Pa&q=85&s=cf911bdb60cdb0bcea5d73766bad573c" alt="QuickSight MySQL connection configuration form with hostname, port, database and credential fields" border width="1059" height="1143" data-path="images/integrations/data-visualization/quicksight_03.png" />

<br />

Now, you have two options on how to fetch the data from ClickHouse. First, you could select a table from the list:

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/m3SFJgFQv2eos7Pa/images/integrations/data-visualization/quicksight_04.png?fit=max&auto=format&n=m3SFJgFQv2eos7Pa&q=85&s=d574a98354e1d76f20e6450352c22ec1" alt="QuickSight table selection interface showing database tables available from ClickHouse" border width="1061" height="845" data-path="images/integrations/data-visualization/quicksight_04.png" />

<br />

Alternatively, you could specify a custom SQL to fetch your data:

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/m3SFJgFQv2eos7Pa/images/integrations/data-visualization/quicksight_05.png?fit=max&auto=format&n=m3SFJgFQv2eos7Pa&q=85&s=3f180b7742aa7d64e9f9e16ca9131eee" alt="QuickSight custom SQL query editor for fetching data from ClickHouse" border width="1061" height="845" data-path="images/integrations/data-visualization/quicksight_05.png" />

<br />

By clicking "Edit/Preview data", you should be able to see the introspected table structure or adjust your custom SQL, if that's how you decided to access the data:

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/m3SFJgFQv2eos7Pa/images/integrations/data-visualization/quicksight_06.png?fit=max&auto=format&n=m3SFJgFQv2eos7Pa&q=85&s=7257661c8f0e5c2de1c96b783b22f5cb" alt="QuickSight data preview showing table structure with columns and sample data" border width="1743" height="1277" data-path="images/integrations/data-visualization/quicksight_06.png" />

<br />

Make sure you have "Direct Query" mode selected in the bottom left corner of the UI:

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/m3SFJgFQv2eos7Pa/images/integrations/data-visualization/quicksight_07.png?fit=max&auto=format&n=m3SFJgFQv2eos7Pa&q=85&s=83c5f6e0fedb1d0224674fdd4db72864" alt="QuickSight interface with Direct Query mode option highlighted in bottom corner" border width="677" height="341" data-path="images/integrations/data-visualization/quicksight_07.png" />

<br />

Now you can proceed with publishing your dataset and creating a new visualization!

<h2 id="known-limitations">
  Known limitations
</h2>

* SPICE import doesn't work as expected; please use Direct Query mode instead. See [#58553](https://github.com/ClickHouse/ClickHouse/issues/58553).
