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

> Cloud SQL for MySQL을 ClickPipes 소스로 설정하는 단계별 가이드

# Cloud SQL for MySQL 소스 설정 가이드

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

이 문서에서는 MySQL ClickPipe를 통해 데이터를 복제할 수 있도록 Cloud SQL for MySQL 인스턴스를 설정하는 방법을 단계별로 안내합니다.

<div id="enable-binlog-retention-gcp">
  ## 바이너리 로그 보존 활성화
</div>

바이너리 로그는 MySQL 서버 인스턴스에서 수행된 데이터 변경 정보를 담고 있는 로그 파일 집합이며, 복제에는 이러한 바이너리 로그 파일이 필요합니다.

<div id="enable-binlog-logging-gcp">
  ### PITR로 바이너리 로깅 활성화
</div>

PITR 기능은 Google Cloud에서 MySQL의 바이너리 로깅 사용 여부를 결정합니다. Cloud Console에서 Cloud SQL 인스턴스를 편집한 뒤 아래 섹션으로 스크롤하여 설정할 수 있습니다.

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/8xU-7NRzcVe16bmG/images/integrations/data-ingestion/clickpipes/mysql/source/gcp/gcp-mysql-pitr.png?fit=max&auto=format&n=8xU-7NRzcVe16bmG&q=85&s=2f1ecd0b62957721060e5a1b4275e841" alt="Cloud SQL에서 PITR 활성화" size="lg" border width="1622" height="1800" data-path="images/integrations/data-ingestion/clickpipes/mysql/source/gcp/gcp-mysql-pitr.png" />

복제 사용 사례에 따라 이 값을 충분히 길게 설정하는 것이 좋습니다.

아직 구성하지 않았다면 Cloud SQL을 편집한 뒤 데이터베이스 플래그 섹션에서 다음 값을 설정하십시오:

1. `binlog_expire_logs_seconds`를 `86400`(1일) 이상으로 설정
2. `binlog_row_metadata`를 `FULL`로 설정
3. `binlog_row_image`를 `FULL`로 설정

이렇게 하려면 인스턴스 개요 페이지 오른쪽 상단의 `Edit` 버튼을 클릭하십시오.

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/8xU-7NRzcVe16bmG/images/integrations/data-ingestion/clickpipes/mysql/source/gcp/gcp-mysql-edit-button.png?fit=max&auto=format&n=8xU-7NRzcVe16bmG&q=85&s=73cb9318e9ebb0f4c46daa4e368f904c" alt="GCP MySQL의 Edit 버튼" size="lg" border width="2174" height="570" data-path="images/integrations/data-ingestion/clickpipes/mysql/source/gcp/gcp-mysql-edit-button.png" />

그런 다음 `Flags` 섹션까지 스크롤한 뒤 위 플래그를 추가하십시오.

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/8xU-7NRzcVe16bmG/images/integrations/data-ingestion/clickpipes/mysql/source/gcp/gcp-mysql-flags.png?fit=max&auto=format&n=8xU-7NRzcVe16bmG&q=85&s=9267705e8927cc2d9f50df29210e391b" alt="GCP에서 바이너리 로그 플래그 설정" size="lg" border width="1174" height="1810" data-path="images/integrations/data-ingestion/clickpipes/mysql/source/gcp/gcp-mysql-flags.png" />

<div id="configure-database-user-gcp">
  ## 데이터베이스 사용자 구성
</div>

Cloud SQL MySQL 인스턴스에 루트 사용자로 연결한 다음, 아래 명령을 실행합니다:

1. ClickPipes 전용 사용자를 생성합니다:

   ```sql theme={null}
   CREATE USER 'clickpipes_user'@'host' IDENTIFIED BY 'some-password';
   ```

2. 스키마 권한을 부여합니다. 다음 예시는 `clickpipes` 데이터베이스(database)에 대한 권한을 보여줍니다. 복제하려는 각 데이터베이스와 호스트에 대해 이 명령을 반복하십시오:

   ```sql theme={null}
   GRANT SELECT ON `clickpipes`.* TO 'clickpipes_user'@'host';
   ```

3. 사용자에게 복제 권한을 부여합니다:

   ```sql theme={null}
   GRANT REPLICATION CLIENT ON *.* TO 'clickpipes_user'@'%';
   GRANT REPLICATION SLAVE ON *.* TO 'clickpipes_user'@'%';
   ```

<div id="configure-network-access-gcp-mysql">
  ## 네트워크 액세스 구성
</div>

Cloud SQL 인스턴스로의 트래픽을 제한하려면 [문서에 안내된 정적 NAT IP 주소](/ko/integrations/clickpipes/home#list-of-static-ips)를 Cloud SQL MySQL 인스턴스의 허용 목록에 추가하십시오.
이 작업은 인스턴스를 편집하거나 Cloud Console 사이드바의 `Connections` 탭으로 이동하여 수행할 수 있습니다.

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/8xU-7NRzcVe16bmG/images/integrations/data-ingestion/clickpipes/mysql/source/gcp/gcp-mysql-ip.png?fit=max&auto=format&n=8xU-7NRzcVe16bmG&q=85&s=7e8d91bd0c578dae1fc0a5d97e1a9a35" alt="GCP MySQL에서 IP 허용 목록 설정" size="lg" border width="1110" height="1598" data-path="images/integrations/data-ingestion/clickpipes/mysql/source/gcp/gcp-mysql-ip.png" />

<div id="download-root-ca-certificate-gcp-mysql">
  ## 루트 CA 인증서 다운로드 및 사용
</div>

Cloud SQL 인스턴스에 연결하려면 루트 CA 인증서를 다운로드해야 합니다.

1. Cloud Console에서 Cloud SQL 인스턴스로 이동합니다.
2. 사이드바에서 `Connections`를 클릭합니다.
3. `Security` 탭을 클릭합니다.
4. `Manage server CA certificates` 섹션에서 하단의 `DOWNLOAD CERTIFICATES` 버튼을 클릭합니다.

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/8xU-7NRzcVe16bmG/images/integrations/data-ingestion/clickpipes/mysql/source/gcp/gcp-mysql-cert.png?fit=max&auto=format&n=8xU-7NRzcVe16bmG&q=85&s=0fc89f3b17c87707daf874f41ca5eac6" alt="GCP MySQL 인증서 다운로드" size="lg" border width="1584" height="1098" data-path="images/integrations/data-ingestion/clickpipes/mysql/source/gcp/gcp-mysql-cert.png" />

5. ClickPipes UI에서 새 MySQL ClickPipe를 만들 때 다운로드한 인증서를 업로드합니다.

<Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/8xU-7NRzcVe16bmG/images/integrations/data-ingestion/clickpipes/mysql/source/gcp/rootca.png?fit=max&auto=format&n=8xU-7NRzcVe16bmG&q=85&s=a1a8e53e830bd0e5e62fad859e1ca2c2" alt="GCP MySQL 인증서 사용" size="lg" border width="1636" height="1170" data-path="images/integrations/data-ingestion/clickpipes/mysql/source/gcp/rootca.png" />
