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

> Tableau Online streamlines the power of data to make people faster and more confident decision makers from anywhere.

# Tableau Online

export const Image = ({img, alt, size = "lg"}) => {
  const normalizedSize = ["sm", "md", "lg"].includes(size) ? size : "lg";
  return <div className={`ch-image-${normalizedSize}`}>
      <Frame>
        <img src={img} alt={alt} />
      </Frame>
    </div>;
};

Tableau Online can connect to ClickHouse Cloud or on-premise ClickHouse setup via MySQL interface using the official MySQL data source.

<h2 id="clickhouse-cloud-setup">
  ClickHouse Cloud setup
</h2>

<Steps>
  <Step title={<>Select <code>Connect your app</code></>} id="select-connect-your-app">
    After creating your ClickHouse Cloud Service, on the `Connect your app` screen, select MySQL from the drop down.

    <Frame>
      <img src="https://mintcdn.com/private-7c7dfe99-detect-table-modification/0yJtAU6cqYAQlCWC/images/_snippets/mysql1.webp?fit=max&auto=format&n=0yJtAU6cqYAQlCWC&q=85&s=2f44cca529d76149c5dd4573069af855" alt="ClickHouse Cloud credentials screen showing MySQL interface selection dropdown" width="3840" height="2138" data-path="images/_snippets/mysql1.webp" />
    </Frame>
  </Step>

  <Step title="Enable the MySQL interface" id="enable-mysql-interface">
    Toggle the switch to enable the MySQL interface for this specific service.
    This will expose port `3306` for this service and prompt you with a MySQL connection screen that includes your unique MySQL username.

    <Frame>
      <img src="https://mintcdn.com/private-7c7dfe99-detect-table-modification/0yJtAU6cqYAQlCWC/images/_snippets/mysql2.webp?fit=max&auto=format&n=0yJtAU6cqYAQlCWC&q=85&s=e1caa8364c2bcf544492c0e8377e6dc7" alt="ClickHouse Cloud MySQL interface enabling toggle and connection details" width="3840" height="2136" data-path="images/_snippets/mysql2.webp" />
    </Frame>

    Alternatively, in order to enable the MySQL interface for an existing service:
  </Step>

  <Step title={<>Select <code>Connect</code></>} id="select-connect">
    Ensure your service is in `Running` state then click on the service you want to enable the MySQL interface for.
    Select "Connect" from the left menu:

    <Frame>
      <img src="https://mintcdn.com/private-7c7dfe99-detect-table-modification/0yJtAU6cqYAQlCWC/images/_snippets/mysql3.webp?fit=max&auto=format&n=0yJtAU6cqYAQlCWC&q=85&s=b92958c170c39fbd884313f1f7a6c3d0" alt="ClickHouse Cloud service connection screen with Connect option highlighted" width="3840" height="2160" data-path="images/_snippets/mysql3.webp" />
    </Frame>
  </Step>

  <Step title={<>Choose <code>MySQL</code></>} id="choose-mysql">
    Select `MySQL` from the `Connect With` drop down.

    <div className="ch-image-md">
      <Frame>
        <img src="https://mintcdn.com/private-7c7dfe99-detect-table-modification/0yJtAU6cqYAQlCWC/images/_snippets/mysql4.webp?fit=max&auto=format&n=0yJtAU6cqYAQlCWC&q=85&s=152f4db09e451c302dc76d563ac414c7" alt="ClickHouse Cloud connection screen showing MySQL option selection" width="1326" height="1046" data-path="images/_snippets/mysql4.webp" />
      </Frame>
    </div>
  </Step>

  <Step title="Enable the MySQL interface" id="enable-mysql-interface-existing-service">
    Toggle the switch to enable the MySQL interface for this specific service.
    This will expose port `3306` for this service and prompt you with your MySQL connection screen that include your unique MySQL username.
  </Step>
</Steps>

<div className="ch-image-md">
  <Frame>
    <img src="https://mintcdn.com/private-7c7dfe99-detect-table-modification/0yJtAU6cqYAQlCWC/images/_snippets/mysql5.webp?fit=max&auto=format&n=0yJtAU6cqYAQlCWC&q=85&s=4d98d6d46dd965ef5aab8b5d388c11c6" alt="ClickHouse Cloud connection screen with MySQL interface enabled showing connection details" width="1320" height="1520" data-path="images/_snippets/mysql5.webp" />
  </Frame>
</div>

<h2 id="creating-multiple-mysql-users-in-clickhouse-cloud">
  Creating a readonly MySQL user in ClickHouse Cloud
</h2>

ClickHouse Cloud automatically creates a `mysql4<subdomain>` user that shares the same password as the default user.
The `<subdomain>` portion corresponds to the first part of your ClickHouse Cloud hostname.

This username format is required for compatibility with tools that establish secure connections but don't include [SNI (Server Name Indication)](https://www.cloudflare.com/learning/ssl/what-is-sni) data in their TLS handshake.
Without SNI information, the system can't perform proper internal routing, so the subdomain hint embedded in the username provides the necessary routing information.
The MySQL console client is an example of a tool that requires this.

<Tip>
  A recommended best practice is to create a new readonly MySQL user.
</Tip>

<Note>
  For a ClickHouse Cloud hostname like `foobar.us-east1.aws.clickhouse.cloud`, the `<subdomain>` part equals to `foobar`, and a custom MySQL username could look like `mysql4foobar_team1`.
</Note>

<Steps>
  <Step title="Create a readonly settings profile" id="create-a-custom-settings-user">
    Create a [settings profile](/reference/statements/create/settings-profile) to apply to your readonly user,
    setting the `readonly` setting to `1`:

    ```sql theme={null}
    CREATE SETTINGS PROFILE readonly_profile SETTINGS readonly = 1
    ```
  </Step>

  <Step title="Create a new readonly MySQL user" id="create-a-readonly-mysql-user">
    [Create a user](/reference/statements/create/user) with a name following this format:

    ```sql theme={null}
    mysql4<subdomain>_<username>
    ```

    Apply the `readonly_profile` to the new user and make sure that the password is in double SHA1 format. For example:

    ```sql theme={null}
    CREATE USER mysql4foobar_readonly
    IDENTIFIED WITH double_sha1_password BY 'YourPassword42$'
    SETTINGS PROFILE 'readonly_profile';
    ```
  </Step>

  <Step title="Grant the new user permissions to access the desired tables" id="grant-the-new-user-the-necessary-permissions">
    [Grant](/reference/statements/grant) the new user the necessary permissions to interact with the desired tables or databases.
    For example, if you want to grant access to `system.query_log` only:

    ```sql theme={null}
    GRANT SELECT ON system.query_log TO mysql4foobar_readonly;
    ```

    <Note>
      For the readonly user, make sure to only grant `SELECT` permissions to the tables you want to access.
    </Note>

    The newly created user can be used to connect to your ClickHouse Cloud service with the MySQL interface.
  </Step>
</Steps>

<h3 id="troubleshooting-multiple-mysql-users-in-clickhouse-cloud">
  Troubleshooting multiple MySQL users in ClickHouse Cloud
</h3>

If you created a new MySQL user, and you see the following error while connecting via MySQL CLI client:

```
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 54
```

In this case, ensure that the username follows the `mysql4<subdomain>_<username>` format, as described ([above](#creating-multiple-mysql-users-in-clickhouse-cloud)).

<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:

```
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.

Additionally, it is recommended to use `use_mysql_types_in_show_columns`
to show the native MySQL types instead of ClickHouse ones in `SHOW [FULL] COLUMNS` query results,
which allows BI tools to properly introspect the database schema when using MySQL connectors.

For example:

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

```xml theme={null}
<profiles>
    <default>
        <use_mysql_types_in_show_columns>1</use_mysql_types_in_show_columns>
    </default>
</profiles>
```

or assign it to a different profile instead of the default one.

If you have the `mysql` binary available, you can test the connection from the commandline.
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
```

```
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.
```

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

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

<h2 id="connecting-tableau-online-to-clickhouse-on-premise-without-ssl">
  Connecting Tableau Online to ClickHouse (on-premise without SSL)
</h2>

Login to your Tableau Cloud site and add a new Published Data Source.

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/svLCKm9RWi4jibqG/images/integrations/data-visualization/tableau_online_01.webp?fit=max&auto=format&n=svLCKm9RWi4jibqG&q=85&s=0bba2ab6b524e720c42146f0c1d36a0e" alt="Tableau Online interface showing the 'New' button to create a published data source" border width="1627" height="1024" data-path="images/integrations/data-visualization/tableau_online_01.webp" />

<br />

Select "MySQL" from the list of available connectors.

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/svLCKm9RWi4jibqG/images/integrations/data-visualization/tableau_online_02.webp?fit=max&auto=format&n=svLCKm9RWi4jibqG&q=85&s=8b9ac143c66e69345b43c061c0d32701" alt="Tableau Online connector selection screen with MySQL option highlighted" border width="1940" height="1114" data-path="images/integrations/data-visualization/tableau_online_02.webp" />

<br />

Specify your connection details gathered during the ClickHouse setup.

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/svLCKm9RWi4jibqG/images/integrations/data-visualization/tableau_online_03.webp?fit=max&auto=format&n=svLCKm9RWi4jibqG&q=85&s=3688db63d5e2f1733e9e06daac1496c3" alt="Tableau Online MySQL connection configuration screen with server, port, database and credential fields" border width="1940" height="1114" data-path="images/integrations/data-visualization/tableau_online_03.webp" />

<br />

Tableau Online will introspect the database and provide a list of available tables. Drag the desired table to the canvas on the right. Additionally, you can click "Update Now" to preview the data, as well as fine-tune the introspected field types or names.

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/svLCKm9RWi4jibqG/images/integrations/data-visualization/tableau_online_04.webp?fit=max&auto=format&n=svLCKm9RWi4jibqG&q=85&s=213ef53e5c9dd2831e18ce0d91bd259a" alt="Tableau Online data source page showing database tables on the left and canvas on the right with drag-and-drop functionality" border width="2277" height="1395" data-path="images/integrations/data-visualization/tableau_online_04.webp" />

<br />

After that, all that remains is to click "Publish As" in the top right corner, and you should be able to use a newly created dataset in Tableau Online as usual.

NB: if you want to use Tableau Online in combination with Tableau Desktop and share ClickHouse datasets between them, make sure you use Tableau Desktop with the default MySQL connector as well, following the setup guide that is displayed [here](https://www.tableau.com/support/drivers) if you select MySQL from the Data Source drop-down. If you have an M1 Mac, check [this troubleshooting thread](https://community.tableau.com/s/question/0D58b0000Ar6OhvCQE/unable-to-install-mysql-driver-for-m1-mac) for a driver installation workaround.

<h2 id="connecting-tableau-online-to-clickhouse-cloud-or-on-premise-setup-with-ssl">
  Connecting Tableau Online to ClickHouse (cloud or on-premise setup with SSL)
</h2>

As it isn't possible to provide the SSL certificates via the Tableau Online MySQL connection setup wizard,
the only way is to use Tableau Desktop to set the connection up, and then export it to Tableau Online. This process is, however, pretty straightforward.

Run Tableau Desktop on a Windows or Mac machine, and select "Connect" -> "To a Server" -> "MySQL".
Likely, it will be required to install the MySQL driver on your machine first.
You can do that by following the setup guide that is displayed [here](https://www.tableau.com/support/drivers) if you select MySQL from the Data Source drop-down.
If you have an M1 Mac, check [this troubleshooting thread](https://community.tableau.com/s/question/0D58b0000Ar6OhvCQE/unable-to-install-mysql-driver-for-m1-mac) for a driver installation workaround.

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/svLCKm9RWi4jibqG/images/integrations/data-visualization/tableau_desktop_01.webp?fit=max&auto=format&n=svLCKm9RWi4jibqG&q=85&s=8ca19515f1a3ae3cf2b459d3961abb8a" alt="Tableau Desktop interface showing the Connect menu with MySQL option highlighted" border width="735" height="659" data-path="images/integrations/data-visualization/tableau_desktop_01.webp" />

<br />

<Note>
  In the MySQL connection setup UI, make sure that the "SSL" option is enabled.
  ClickHouse Cloud's SSL certificate is signed by [Let's Encrypt](https://letsencrypt.org/certificates/).
  You can download this root cert [here](https://letsencrypt.org/certs/isrgrootx1.pem).
</Note>

Provide your ClickHouse Cloud instance MySQL user credentials and the path to the downloaded root certificate.

<Image size="sm" img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/svLCKm9RWi4jibqG/images/integrations/data-visualization/tableau_desktop_02.webp?fit=max&auto=format&n=svLCKm9RWi4jibqG&q=85&s=daf204492f91fdf54465792def9cc1bf" alt="Tableau Desktop MySQL connection dialog with SSL option enabled and fields for server, username, password and certificate" border width="496" height="567" data-path="images/integrations/data-visualization/tableau_desktop_02.webp" />

<br />

Choose the desired tables as usual (similarly to Tableau Online),
and select "Server" -> "Publish Data Source" -> Tableau Cloud.

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/svLCKm9RWi4jibqG/images/integrations/data-visualization/tableau_desktop_03.webp?fit=max&auto=format&n=svLCKm9RWi4jibqG&q=85&s=129ae7087aef871822a87a320834ed17" alt="Tableau Desktop showing Server menu with Publish Data Source option highlighted" border width="813" height="321" data-path="images/integrations/data-visualization/tableau_desktop_03.webp" />

<br />

IMPORTANT: you need to select "Embedded password" in "Authentication" options.

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/svLCKm9RWi4jibqG/images/integrations/data-visualization/tableau_desktop_04.webp?fit=max&auto=format&n=svLCKm9RWi4jibqG&q=85&s=335bd691d06cbb85e1f6b9e653d41433" alt="Tableau Desktop publish dialog showing Authentication options with Embedded password selected" border width="775" height="643" data-path="images/integrations/data-visualization/tableau_desktop_04.webp" />

<br />

Additionally, choose "Update workbook to use the published data source".

<Image size="sm" img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/svLCKm9RWi4jibqG/images/integrations/data-visualization/tableau_desktop_05.webp?fit=max&auto=format&n=svLCKm9RWi4jibqG&q=85&s=275e09d373302fbf53355f8300cfa256" alt="Tableau Desktop publish dialog with 'Update workbook to use the published data source' option checked" border width="373" height="649" data-path="images/integrations/data-visualization/tableau_desktop_05.webp" />

<br />

Finally, click "Publish", and your datasource with embedded credentials will be opened automatically in Tableau Online.

<h2 id="known-limitations-clickhouse-2311">
  Known limitations (ClickHouse 23.11)
</h2>

All the known limitations has been fixed in ClickHouse `23.11`. If you encounter any other incompatibilities, please don't hesitate to [contact us](https://clickhouse.com/company/contact) or create a [new issue](https://github.com/ClickHouse/ClickHouse/issues).
