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

> Looker Studio는 이전에 Google Data Studio로 불렸으며, 데이터를 맞춤형의 유익한 보고서와 대시보드로 변환하는 온라인 도구입니다.

# Looker Studio

export const PartnerBadge = () => {
  return <div className="PartnerBadge">
            <div className="PartnerBadgeIcon">
                <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
                    <polyline points="12.5 9.5 10 12 6 11 2.5 8.5" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                    <polyline points="4.54 4.41 8 3.5 11.46 4.41" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                    <path d="M2.15,3.78 L0.55,6.95 A0.5,0.5 0,0,0 0.77,7.62 L2.5,8.5 L4.54,4.41 L2.82,3.55 A0.5,0.5 0,0,0 2.15,3.78 Z" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                    <path d="M13.5,8.5 L15.23,7.62 A0.5,0.5 0,0,0 15.45,6.95 L13.85,3.78 A0.5,0.5 0,0,0 13.18,3.55 L11.46,4.41 Z" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                    <path d="M11.5,4.5 L9,4.5 L6.15,7.27 A0.5,0.5 0,0,0 6.24,8.05 C7.33,8.74 8.81,8.72 10,7.5 L12.5,9.5 L13.5,8.5" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                    <polyline points="7.75 13.5 5.15 12.85 3.5 11.67" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="1" />
                </svg>
            </div>
            파트너 통합
        </div>;
};

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

Looker Studio는 공식 Google MySQL 데이터 소스를 사용해 MySQL 인터페이스를 통해 ClickHouse에 연결할 수 있습니다.

<div id="clickhouse-cloud-setup">
  ## ClickHouse Cloud 설정
</div>

<Steps>
  <Step>
    #### `Connect your app` 선택

    ClickHouse Cloud 서비스를 생성한 후 `Connect your app` 화면의 드롭다운에서 MySQL을 선택합니다.

    <Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/mysql1.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=300a6249679fc22967054a030469eedf" alt="MySQL 인터페이스 선택 드롭다운이 표시된 ClickHouse Cloud 자격 증명 화면" border width="3840" height="2138" data-path="images/_snippets/mysql1.png" />
  </Step>

  <Step>
    #### MySQL 인터페이스 활성화

    이 특정 서비스에서 MySQL 인터페이스를 활성화하려면 스위치를 켭니다.
    그러면 이 서비스에 포트 `3306`이 노출되고, 고유한 MySQL 사용자 이름이 포함된 MySQL 연결 화면이 표시됩니다.

    <Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/mysql2.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=d37ed831615fdd8ebef56e7911db23ee" alt="MySQL 인터페이스 활성화 토글과 연결 정보가 표시된 ClickHouse Cloud 화면" border width="3840" height="2136" data-path="images/_snippets/mysql2.png" />

    또는 기존 서비스에서 MySQL 인터페이스를 활성화하려면 다음과 같이 하십시오.
  </Step>

  <Step>
    #### `Connect` 선택

    서비스가 `Running` 상태인지 확인한 다음, MySQL 인터페이스를 활성화하려는 서비스를 클릭합니다.
    왼쪽 메뉴에서 "Connect"를 선택합니다:

    <Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/mysql3.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=0756d99a3b512c12c2bdf4fc5b6c679f" alt="Connect 옵션이 강조 표시된 ClickHouse Cloud 서비스 연결 화면" border width="3840" height="2160" data-path="images/_snippets/mysql3.png" />
  </Step>

  <Step>
    #### `MySQL` 선택

    `Connect With` 드롭다운에서 `MySQL`을 선택합니다.

    <Image size="md" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/mysql4.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=b6739abee187d595a6b38bb0d807b13d" alt="MySQL 옵션 선택이 표시된 ClickHouse Cloud 연결 화면" border width="1326" height="1046" data-path="images/_snippets/mysql4.png" />
  </Step>

  <Step>
    #### MySQL 인터페이스 활성화

    이 특정 서비스에서 MySQL 인터페이스를 활성화하려면 스위치를 켭니다.
    그러면 이 서비스에 포트 `3306`이 노출되고, 고유한 MySQL 사용자 이름이 포함된 MySQL 연결 화면이 표시됩니다.
  </Step>
</Steps>

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/mysql5.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=7d387515699c20775b22da725c59b0a8" alt="연결 정보가 표시되도록 MySQL 인터페이스가 활성화된 ClickHouse Cloud 연결 화면" border width="1320" height="1520" data-path="images/_snippets/mysql5.png" />

<div id="creating-multiple-mysql-users-in-clickhouse-cloud">
  ## ClickHouse Cloud에서 읽기 전용 MySQL 사용자 생성하기
</div>

ClickHouse Cloud는 기본 사용자와 동일한 비밀번호를 사용하는 `mysql4<subdomain>` 사용자를 자동으로 생성합니다.
`<subdomain>` 부분은 ClickHouse Cloud 호스트명의 첫 번째 부분에 해당합니다.

이 사용자 이름 형식은 TLS 핸드셰이크에 [SNI (Server Name Indication)](https://www.cloudflare.com/learning/ssl/what-is-sni) 데이터를 포함하지 않으면서 보안 연결을 설정하는 도구와의 호환성을 위해 필요합니다.
SNI 정보가 없으면 시스템이 내부 라우팅을 올바르게 수행할 수 없으므로, 사용자 이름에 포함된 서브도메인 힌트가 필요한 라우팅 정보를 제공합니다.
MySQL 콘솔 클라이언트가 이러한 도구의 예입니다.

<Tip>
  권장되는 모범 사례는 새로운 읽기 전용 MySQL 사용자를 생성하는 것입니다.
</Tip>

<Note>
  ClickHouse Cloud 호스트명이 `foobar.us-east1.aws.clickhouse.cloud`인 경우 `<subdomain>` 부분은 `foobar`이며, 사용자 지정 MySQL 사용자 이름은 `mysql4foobar_team1`과 같은 형식이 될 수 있습니다.
</Note>

<Steps>
  <Step>
    #### 읽기 전용 설정 프로필 만들기

    읽기 전용 사용자에게 적용할 [설정 프로필](/ko/reference/statements/create/settings-profile)을 만들고
    `readonly` 설정을 `1`로 지정합니다:

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

  <Step>
    #### 새 읽기 전용 MySQL 사용자 만들기

    다음 형식을 따르는 이름으로 [사용자를 생성](/ko/reference/statements/create/user)합니다:

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

    새 사용자에 `readonly_profile`을 적용하고 비밀번호가 double SHA1 형식인지 확인합니다. 예를 들면 다음과 같습니다:

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

  <Step>
    #### 새 사용자에게 필요한 권한 부여하기

    원하는 테이블 또는 데이터베이스에 접근할 수 있도록 새 사용자에게 필요한 권한을 [부여](/ko/reference/statements/grant)합니다.
    예를 들어 `system.query_log`에만 접근 권한을 부여하려는 경우 다음과 같습니다:

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

    <Note>
      읽기 전용 사용자에게는 접근하려는 테이블에 대해 `SELECT` 권한만 부여하십시오.
    </Note>

    새로 생성한 사용자는 MySQL 인터페이스를 통해 ClickHouse Cloud 서비스에 연결하는 데 사용할 수 있습니다.
  </Step>
</Steps>

<div id="troubleshooting-multiple-mysql-users-in-clickhouse-cloud">
  ### ClickHouse Cloud에서 여러 MySQL 사용자 문제 해결
</div>

새 MySQL 사용자를 생성한 뒤 MySQL CLI 클라이언트로 연결할 때 다음과 같은 오류가 표시되면:

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

이 경우 사용자 이름이 [위](#creating-multiple-mysql-users-in-clickhouse-cloud)에서 설명한 대로 `mysql4<subdomain>_<username>` 포맷을 따르는지 확인하십시오.

<div id="on-premise-clickhouse-server-setup">
  ## 온프레미스 ClickHouse 서버 설정
</div>

MySQL 인터페이스가 활성화된 ClickHouse 서버를 설정하는 방법은
[공식 문서](/ko/concepts/features/interfaces/mysql)를 참조하십시오.

서버의 `config.xml`에 항목을 추가하는 것 외에

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

또한 MySQL interface를 사용할 사용자에게는
[Double SHA1 비밀번호 암호화](/ko/concepts/features/configuration/settings/settings-users#user-namepassword)를
사용하는 것이 *필수*입니다.

셸에서 Double SHA1로 암호화된 임의의 비밀번호를 생성하는 방법:

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

출력은 다음과 같이 표시됩니다:

```
LZOQYnqQN4L/T6L0
fbc958cc745a82188a51f30de69eebfc67c40ee4
```

첫 번째 줄은 생성된 비밀번호이고, 두 번째 줄은 ClickHouse 구성에 사용할 수 있는 hash입니다.

다음은 생성된 hash를 사용하는 `mysql_user`의 예시 구성입니다:

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

`password_double_sha1_hex` 항목을 직접 생성한 Double SHA1 해시로 대체하십시오.

또한 `SHOW [FULL] COLUMNS` 쿼리 결과에서 ClickHouse 타입 대신 네이티브 MySQL 타입을 표시하도록 `use_mysql_types_in_show_columns`를 사용하는 것이 좋습니다.
이렇게 하면 MySQL connector를 사용할 때 BI 도구가 데이터베이스 스키마를 올바르게 파악할 수 있습니다.

예시:

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

또는 기본 프로필 대신 다른 프로필에 할당할 수 있습니다.

`mysql` 실행 파일을 사용할 수 있으면 명령줄에서 연결을 테스트할 수 있습니다.
위의 예시 사용자 이름(`mysql_user`)과 비밀번호(`LZOQYnqQN4L/T6L0`)를 사용하면 명령줄은 다음과 같습니다.

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

마지막으로, ClickHouse 서버가 원하는 IP 주소에서 연결을 수신하도록 구성합니다. 예를 들어, 모든 주소에서 수신하려면 `config.xml`에서 다음 항목의 주석을 해제하세요:

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

<div id="connecting-looker-studio-to-clickhouse">
  ## Looker Studio를 ClickHouse에 연결하기
</div>

먼저 Google 계정으로 [https://lookerstudio.google.com에](https://lookerstudio.google.com에) 로그인한 다음 새 데이터 소스를 생성합니다:

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/m3SFJgFQv2eos7Pa/images/integrations/data-visualization/looker_studio_01.png?fit=max&auto=format&n=m3SFJgFQv2eos7Pa&q=85&s=88cd962f89d17b36c1c8191656bbd5bb" alt="Looker Studio 인터페이스에서 새 데이터 소스 만들기" border width="1229" height="683" data-path="images/integrations/data-visualization/looker_studio_01.png" />

<br />

Google에서 제공하는 공식 MySQL 커넥터(이름은 **MySQL**)를 검색합니다:

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/m3SFJgFQv2eos7Pa/images/integrations/data-visualization/looker_studio_02.png?fit=max&auto=format&n=m3SFJgFQv2eos7Pa&q=85&s=1aad591260145cb2697203e479b5f9d3" alt="Looker Studio 커넥터 목록에서 MySQL 커넥터 검색" border width="1923" height="709" data-path="images/integrations/data-visualization/looker_studio_02.png" />

<br />

연결 정보를 입력합니다. MySQL 인터페이스 포트는 기본적으로 9004이며,
서버 구성에 따라 달라질 수 있습니다.

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/m3SFJgFQv2eos7Pa/images/integrations/data-visualization/looker_studio_03.png?fit=max&auto=format&n=m3SFJgFQv2eos7Pa&q=85&s=34174045b115406de1014be932ad8735" alt="Looker Studio에서 ClickHouse MySQL 연결 정보 입력하기" border width="999" height="1329" data-path="images/integrations/data-visualization/looker_studio_03.png" />

<br />

이제 ClickHouse에서 데이터를 가져오는 방법은 두 가지입니다. 첫 번째는 Table Browser 기능을 사용하는 것입니다:

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/m3SFJgFQv2eos7Pa/images/integrations/data-visualization/looker_studio_04.png?fit=max&auto=format&n=m3SFJgFQv2eos7Pa&q=85&s=c540b95ecfccb9070b443cf0d159dd82" alt="Looker Studio에서 Table Browser를 사용해 ClickHouse 테이블 선택하기" border width="1299" height="1333" data-path="images/integrations/data-visualization/looker_studio_04.png" />

<br />

또는 데이터를 가져오기 위해 사용자 지정 쿼리를 지정할 수 있습니다:

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/m3SFJgFQv2eos7Pa/images/integrations/data-visualization/looker_studio_05.png?fit=max&auto=format&n=m3SFJgFQv2eos7Pa&q=85&s=103b81a56287337b42e28402af2094a3" alt="Looker Studio에서 사용자 지정 SQL 쿼리를 사용해 ClickHouse에서 데이터 가져오기" border width="1518" height="1333" data-path="images/integrations/data-visualization/looker_studio_05.png" />

<br />

마지막으로, 검사된 테이블 구조를 확인하고 필요한 경우 데이터 타입을 조정할 수 있습니다.

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/m3SFJgFQv2eos7Pa/images/integrations/data-visualization/looker_studio_06.png?fit=max&auto=format&n=m3SFJgFQv2eos7Pa&q=85&s=9846efdc85372bad3aa3bed9f26f889b" alt="Looker Studio에서 검사된 ClickHouse 테이블 구조 보기" border width="1774" height="1114" data-path="images/integrations/data-visualization/looker_studio_06.png" />

<br />

이제 데이터를 탐색하거나 새 보고서를 만들 수 있습니다!

<div id="using-looker-studio-with-clickhouse-cloud">
  ## ClickHouse Cloud에서 Looker Studio 사용
</div>

ClickHouse Cloud를 사용하는 경우 먼저 MySQL 인터페이스를 활성화해야 합니다. 연결 대화상자의 "MySQL" 탭에서 활성화할 수 있습니다.

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/m3SFJgFQv2eos7Pa/images/integrations/data-visualization/looker_studio_enable_mysql.png?fit=max&auto=format&n=m3SFJgFQv2eos7Pa&q=85&s=a1b4830e21f707eebd9e5eb5b9c28637" alt="ClickHouse Cloud 설정에서 MySQL 인터페이스 활성화" border width="1748" height="684" data-path="images/integrations/data-visualization/looker_studio_enable_mysql.png" />

<br />

Looker Studio UI에서 "Enable SSL" 옵션을 선택합니다. ClickHouse Cloud의 SSL 인증서는 [Let's Encrypt](https://letsencrypt.org/certificates/)가 서명한 인증서입니다. 이 루트 인증서는 [여기](https://letsencrypt.org/certs/isrgrootx1.pem)에서 다운로드할 수 있습니다.

<Image size="md" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/m3SFJgFQv2eos7Pa/images/integrations/data-visualization/looker_studio_mysql_cloud.png?fit=max&auto=format&n=m3SFJgFQv2eos7Pa&q=85&s=7b99e1635657943ad7ff618d8b507f7f" alt="ClickHouse Cloud SSL 설정이 적용된 Looker Studio 연결 구성" border width="858" height="530" data-path="images/integrations/data-visualization/looker_studio_mysql_cloud.png" />

<br />

나머지 단계는 이전 섹션에 설명된 내용과 동일합니다.
