데이터베이스 플래그 구성

이 페이지에서는 Cloud SQL에 데이터베이스 플래그를 구성하는 방법을 설명하고 인스턴스에 설정할 수 있는 플래그를 알아봅니다. 데이터베이스 플래그는 MySQL 매개변수 조정, 옵션 조정, 인스턴스 구성 및 조정을 포함한 여러 작업에 사용합니다.

경우에 따라 한 플래그를 설정할 때 원하는 기능을 완전히 활성화하기 위해 다른 플래그를 설정해야 할 수도 있습니다. 예를 들어 느린 쿼리 로깅을 사용 설정하여 Google Cloud 콘솔 로그 탐색기를 통해 로그를 보려면 slow_query_log 플래그를 on으로, log_output 플래그를 FILE로 설정해야 합니다.

데이터베이스 인스턴스의 플래그를 설정, 삭제, 수정하면 데이터베이스가 다시 시작될 수 있습니다. 플래그 값은 인스턴스를 삭제하기 전까지 유지됩니다. 인스턴스가 복제본의 소스이며 인스턴스를 다시 시작하는 경우 복제본은 인스턴스의 현재 구성에 맞게 다시 시작됩니다.

데이터베이스 플래그 구성

데이터베이스 플래그 설정

콘솔

  1. Google Cloud 콘솔에서 데이터베이스 플래그를 설정할 Cloud SQL 인스턴스가 포함된 프로젝트를 선택합니다.
  2. 인스턴스를 열고 수정을 클릭합니다.
  3. 플래그 섹션까지 아래로 스크롤합니다.
  4. 이전에 인스턴스에 설정되지 않은 플래그를 설정하려면 항목 추가를 클릭하고 드롭다운 메뉴에서 플래그를 선택한 다음 값을 설정합니다.
  5. 저장을 클릭하여 변경사항을 저장합니다.
  6. 개요 페이지의 플래그에서 변경사항을 확인합니다.

gcloud

인스턴스를 수정합니다.

gcloud sql instances patch INSTANCE_NAME --database-flags=FLAG1=VALUE1,FLAG2=VALUE2

이 명령어는 이전에 설정한 모든 데이터베이스 플래그를 덮어씁니다. 이전에 설정된 플래그를 유지하고 새 플래그를 추가하려면 인스턴스에 설정하려는 모든 플래그의 값을 포함합니다. 명확하게 포함되지 않은 플래그는 기본값으로 설정됩니다. 값을 가지지 않는 플래그의 경우 플래그 이름 뒤에 등호('=')를 지정합니다.

예를 들어 general_log, skip_show_database, wait_timeout 플래그를 설정하려면 다음 명령어를 사용하면 됩니다.

gcloud sql instances patch INSTANCE_NAME \
  --database-flags=general_log=on,skip_show_database=on,wait_timeout=200000

Terraform

데이터베이스 플래그를 추가하려면 Terraform 리소스를 사용합니다.

resource "google_sql_database_instance" "instance" {
  database_version = "MYSQL_8_0"
  name             = "mysql-instance"
  region           = "us-central1"
  settings {
    database_flags {
      name  = "general_log"
      value = "on"
    }
    database_flags {
      name  = "skip_show_database"
      value = "on"
    }
    database_flags {
      name  = "wait_timeout"
      value = "200000"
    }
    disk_type = "PD_SSD"
    tier      = "db-n1-standard-2"
  }
  # set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
  # use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
  deletion_protection = false
}

변경사항 적용

Google Cloud 프로젝트에 Terraform 구성을 적용하려면 다음 섹션의 단계를 완료하세요.

Cloud Shell 준비

  1. Cloud Shell을 실행합니다.
  2. Terraform 구성을 적용할 기본 Google Cloud 프로젝트를 설정합니다.

    이 명령어는 프로젝트당 한 번만 실행하면 되며 어떤 디렉터리에서도 실행할 수 있습니다.

    export GOOGLE_CLOUD_PROJECT=PROJECT_ID

    Terraform 구성 파일에서 명시적 값을 설정하면 환경 변수가 재정의됩니다.

디렉터리 준비

각 Terraform 구성 파일에는 자체 디렉터리(루트 모듈이라고도 함)가 있어야 합니다.

  1. Cloud Shell에서 디렉터리를 만들고 해당 디렉터리 내에 새 파일을 만드세요. 파일 이름에는 .tf 확장자가 있어야 합니다(예: main.tf). 이 튜토리얼에서는 파일을 main.tf라고 합니다.
    mkdir DIRECTORY && cd DIRECTORY && touch main.tf
  2. 튜토리얼을 따라 하는 경우 각 섹션이나 단계에서 샘플 코드를 복사할 수 있습니다.

    샘플 코드를 새로 만든 main.tf에 복사합니다.

    필요한 경우 GitHub에서 코드를 복사합니다. 이는 Terraform 스니펫이 엔드 투 엔드 솔루션의 일부인 경우에 권장됩니다.

  3. 환경에 적용할 샘플 매개변수를 검토하고 수정합니다.
  4. 변경사항을 저장합니다.
  5. Terraform을 초기화합니다. 이 작업은 디렉터리당 한 번만 수행하면 됩니다.
    terraform init

    원하는 경우 최신 Google 공급업체 버전을 사용하려면 -upgrade 옵션을 포함합니다.

    terraform init -upgrade

변경사항 적용

  1. 구성을 검토하고 Terraform에서 만들거나 업데이트할 리소스가 예상과 일치하는지 확인합니다.
    terraform plan

    필요에 따라 구성을 수정합니다.

  2. 다음 명령어를 실행하고 프롬프트에 yes를 입력하여 Terraform 구성을 적용합니다.
    terraform apply

    Terraform에 '적용 완료' 메시지가 표시될 때까지 기다립니다.

  3. 결과를 보려면 Google Cloud 프로젝트를 엽니다. Google Cloud 콘솔에서 UI의 리소스로 이동하여 Terraform이 리소스를 만들었거나 업데이트했는지 확인합니다.

변경사항 삭제

변경사항을 삭제하려면 다음 단계를 따르세요.

  1. Terraform 구성 파일에서 삭제 보호를 사용 중지하려면 deletion_protection 인수를 false로 설정합니다.
    deletion_protection =  "false"
  2. 다음 명령어를 실행하고 프롬프트에 yes를 입력하여 업데이트된 Terraform 구성을 적용합니다.
    terraform apply
  1. 다음 명령어를 실행하고 프롬프트에 yes를 입력하여 이전에 Terraform 구성에 적용된 리소스를 삭제합니다.

    terraform destroy

REST v1

기존 데이터베이스에 플래그를 설정하려면 다음 안내를 따르세요.

요청 데이터를 사용하기 전에 다음을 바꿉니다.

  • project-id: 프로젝트 ID
  • instance-id: 인스턴스 ID

HTTP 메서드 및 URL:

PATCH https://sqladmin.googleapis.com/v1/projects/project-id/instances/instance-id

JSON 요청 본문:

{
  "settings":
  {
    "databaseFlags":
    [
      {
        "name": "flag_name",
        "value": "flag_value"
      }
    ]
  }
}

요청을 보내려면 다음 옵션 중 하나를 펼칩니다.

다음과 비슷한 JSON 응답이 표시됩니다.

예를 들어 기존 데이터베이스에 general_log 플래그를 설정하려면 다음을 사용하세요.

요청 데이터를 사용하기 전에 다음을 바꿉니다.

  • project-id: 프로젝트 ID
  • instance-id: 인스턴스 ID

HTTP 메서드 및 URL:

PATCH https://sqladmin.googleapis.com/v1/projects/project-id/instances/instance-id

JSON 요청 본문:

{
  "settings":
  {
    "databaseFlags":
    [
      {
        "name": "general_log",
        "value": "on"
      }
    ]
  }
}

요청을 보내려면 다음 옵션 중 하나를 펼칩니다.

다음과 비슷한 JSON 응답이 표시됩니다.

데이터베이스에 기존에 구성된 플래그가 있는 경우 이전 명령어를 수정하여 해당 플래그를 포함할 수 있습니다. PATCH 명령어는 기존 플래그를 요청에 지정된 플래그로 덮어씁니다.

REST v1beta4

기존 데이터베이스에 플래그를 설정하려면 다음 안내를 따르세요.

요청 데이터를 사용하기 전에 다음을 바꿉니다.

  • project-id: 프로젝트 ID
  • instance-id: 인스턴스 ID

HTTP 메서드 및 URL:

PATCH https://sqladmin.googleapis.com/sql/v1beta4/projects/project-id/instances/instance-id

JSON 요청 본문:

{
  "settings":
  {
    "databaseFlags":
    [
      {
        "name": "flag_name",
        "value": "flag_value"
      }
    ]
  }
}

요청을 보내려면 다음 옵션 중 하나를 펼칩니다.

다음과 비슷한 JSON 응답이 표시됩니다.

예를 들어 기존 데이터베이스에 general_log 플래그를 설정하려면 다음을 사용하세요.

요청 데이터를 사용하기 전에 다음을 바꿉니다.

  • project-id: 프로젝트 ID
  • instance-id: 인스턴스 ID

HTTP 메서드 및 URL:

PATCH https://sqladmin.googleapis.com/sql/v1beta4/projects/project-id/instances/instance-id

JSON 요청 본문:

{
  "settings":
  {
    "databaseFlags":
    [
      {
        "name": "general_log",
        "value": "on"
      }
    ]
  }
}

요청을 보내려면 다음 옵션 중 하나를 펼칩니다.

다음과 비슷한 JSON 응답이 표시됩니다.

데이터베이스에 기존에 구성된 플래그가 있는 경우 이전 명령어를 수정하여 해당 플래그를 포함할 수 있습니다. PATCH 명령어는 기존 플래그를 요청에 지정된 플래그로 덮어씁니다.

모든 플래그를 삭제해 기본값으로 지정

콘솔

  1. Google Cloud 콘솔에서 모든 플래그를 삭제하려는 Cloud SQL 인스턴스가 포함된 프로젝트를 선택합니다.
  2. 인스턴스를 열고 수정을 클릭합니다.
  3. 데이터베이스 플래그 섹션을 엽니다.
  4. 표시된 모든 플래그 옆에 있는 X를 클릭합니다.
  5. 저장을 클릭하여 변경사항을 저장합니다.

gcloud

인스턴스의 모든 플래그를 기본값으로 지정합니다.

gcloud sql instances patch INSTANCE_NAME \
--clear-database-flags

인스턴스를 다시 시작할지 묻는 메시지가 표시됩니다.

REST v1

기존 인스턴스의 모든 플래그를 삭제하려면 다음을 사용합니다.

요청 데이터를 사용하기 전에 다음을 바꿉니다.

  • project-id: 프로젝트 ID
  • instance-id: 인스턴스 ID

HTTP 메서드 및 URL:

PATCH https://sqladmin.googleapis.com/v1/projects/project-id/instances/instance-id

JSON 요청 본문:

{
  "settings":
  {
    "databaseFlags": []
  }
}

요청을 보내려면 다음 옵션 중 하나를 펼칩니다.

다음과 비슷한 JSON 응답이 표시됩니다.

REST v1beta4

기존 인스턴스의 모든 플래그를 삭제하려면 다음을 사용합니다.

요청 데이터를 사용하기 전에 다음을 바꿉니다.

  • project-id: 프로젝트 ID
  • instance-id: 인스턴스 ID

HTTP 메서드 및 URL:

PATCH https://sqladmin.googleapis.com/sql/v1beta4/projects/project-id/instances/instance-id

JSON 요청 본문:

{
  "settings":
  {
    "databaseFlags": []
  }
}

요청을 보내려면 다음 옵션 중 하나를 펼칩니다.

다음과 비슷한 JSON 응답이 표시됩니다.

데이터베이스 플래그의 현재 값 보기

MySQL 시스템 변수의 모든 현재 값을 보려면 mysql 클라이언트에서 인스턴스에 로그인하고 다음 문을 입력합니다.

 SHOW VARIABLES;

지원되는 플래그(아래 참조)의 값만 변경할 수 있습니다.

인스턴스에 설정된 데이터베이스 플래그 확인

Cloud SQL 인스턴스에 설정된 플래그를 확인하려면 다음 안내를 따르세요.

콘솔

  1. Google Cloud 콘솔에서 설정된 데이터베이스 플래그를 확인할 Cloud SQL 인스턴스가 포함된 프로젝트를 선택합니다.
  2. 인스턴스를 선택하여 인스턴스 개요 페이지를 엽니다.

    데이터베이스 플래그 섹션에 설정된 데이터베이스 플래그가 나열됩니다.

gcloud

인스턴스 상태를 가져옵니다.

gcloud sql instances describe INSTANCE_NAME

출력에서 데이터베이스 플래그는 databaseFlags 컬렉션으로 settings 아래에 나열됩니다. 출력에서 플래그 표시에 대한 자세한 내용은 인스턴스 리소스 표시를 참조하세요.

REST v1

인스턴스에 구성된 플래그를 나열하려면 다음을 사용합니다.

요청 데이터를 사용하기 전에 다음을 바꿉니다.

  • project-id: 프로젝트 ID
  • instance-id: 인스턴스 ID

HTTP 메서드 및 URL:

GET https://sqladmin.googleapis.com/v1/projects/project-id/instances/instance-id

요청을 보내려면 다음 옵션 중 하나를 펼칩니다.

다음과 비슷한 JSON 응답이 표시됩니다.

출력에서 databaseFlags 필드를 확인합니다.

REST v1beta4

인스턴스에 구성된 플래그를 나열하려면 다음을 사용합니다.

요청 데이터를 사용하기 전에 다음을 바꿉니다.

  • project-id: 프로젝트 ID
  • instance-id: 인스턴스 ID

HTTP 메서드 및 URL:

GET https://sqladmin.googleapis.com/sql/v1beta4/projects/project-id/instances/instance-id

요청을 보내려면 다음 옵션 중 하나를 펼칩니다.

다음과 비슷한 JSON 응답이 표시됩니다.

출력에서 databaseFlags 필드를 확인합니다.

Cloud SQL에서 관리하는 플래그

Cloud SQL은 인스턴스 머신 유형에 따라 특정 시스템 플래그를 조정합니다.

innodb_buffer_pool_instances
  • db-f1-micro 및 db-g1-small인 경우 1개
  • RAM < 7.5GB인 경우 1개
  • 7.5GB <= RAM < 13GB인 경우 2개
  • 13GB <= RAM < 26GB인 경우 4개
  • RAM >= 26GB인 경우 8개

지원되는 플래그

Cloud SQL에서 지원되는 플래그는 MySQL에 가장 많이 요청되는 플래그입니다. 아래에 언급되지 않은 플래그는 지원되지 않습니다.

특정 플래그의 경우 Cloud SQL은 MySQL과는 다른 값 또는 범위의 매개변수 또는 옵션을 지원합니다.

플래그는 명시된 경우를 제외하고는 Cloud SQL에서 지원하는 모든 버전의 MySQL에 적용됩니다.

A | B | C | D | E | F | G | H | I | L | M | N | O | P | Q | R | S | T | U | W

Cloud SQL 플래그 유형
허용 값 및 참고 사항
다시 시작
필요 여부
activate_all_roles_on_login boolean
on | off
기본값: off
아니요
autocommit boolean
on | off
기본값: on
아니요
auto_increment_increment integer
1 ... 65535
아니요
auto_increment_offset integer
1 ... 65535
아니요
automatic_sp_privileges boolean
on | off
기본값: on
아니요
back_log integer
1 ... 65535
기본값: max_connections
binlog_cache_size integer
4096 ... 9223372036854775807
아니요
binlog_expire_logs_seconds integer
0 또는 86400 (1 day) ... 4294967295 (max value)
기본값은 2592000이며 30일에 해당합니다.

이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

아니요
binlog_group_commit_sync_delay 0 ... 1000000

MySQL 5.7, 8.0에서 지원됨

기본값은 0입니다.

아니요
binlog_group_commit_sync_no_delay_count 0 ... 1000000

MySQL 5.7, 8.0에서 지원됨

기본값은 0입니다.

아니요
binlog_gtid_simple_recovery boolean
on | off
기본값: on
binlog_order_commits boolean
on | off
기본값: on

이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

아니요
binlog_row_image enumeration
full(기본값), minimal 또는 noblob
아니요
binlog_row_metadata enumeration
full 또는 minimal(기본값)
아니요
binlog_row_value_options string
PARTIAL_JSON
아니요
binlog_rows_query_log_events boolean
on | off
기본값: off
아니요
binlog_stmt_cache_size 4096 ... 9223372036854775807 아니요
binlog_transaction_dependency_history_size integer

이 플래그 및 허용되는 값을 사용하는 방법에 대한 자세한 내용은 병렬 복제 구성을 참조하세요.

아니요
binlog_transaction_dependency_tracking enumeration

이 플래그 및 허용되는 값을 사용하는 방법에 대한 자세한 내용은 병렬 복제 구성을 참조하세요.

아니요
block_encryption_mode string
aes-keylen-mode
기본값: aes-128-ECB
아니요
bulk_insert_buffer_size integer
0 ... 4294967295
기본값: 8388608
아니요
collation_connection string
기본값:
MySQL 8.0 - utf8mb4_0900_ai_ci

이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

아니요
collation_server string
기본값:
MySQL 5.7 - utf8_general_ci
MySQL 8.0 - utf8mb4_0900_ai_ci
아니요
character_set_client string

기본값:
MySQL 5.7: utf8
MySQL 8.0: utf8mb4

이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

아니요
character_set_connection string
기본값:
MySQL 5.7: utf8
MySQL 8.0: utf8mb4

이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

아니요
character_set_results string
utf8 or utf8mb4
기본값:
MySQL 5.7: utf8
MySQL 8.0: utf8mb4

이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

아니요
character_set_server string
utf8 또는 utf8mb4 (권장)
check_proxy_users boolean
on | off
기본값: off
아니요
cloudsql_allow_analyze_table boolean on | off
기본값: off
아니요
cloudsql_iam_authentication boolean on | off
기본값: off
Cloud SQL용 MySQL 5.7 및 8.0에서 지원됩니다.
아니요
cloudsql_ignore_innodb_encryption boolean on | off
기본값: off
아니요
cloudsql_mysql_audit_data_masking_cmds string
"", dql, dml, ddl, dcl, show, call, create_udf, drop_function, create_procedure, create_function, drop_procedure, alter_procedure, alter_function, create_trigger, drop_trigger, create_event, alter_event, drop_event, create_db, drop_db, alter_db, create_user, drop_user, rename_user, alter_user, create_table, create_index, alter_table, drop_table, drop_index, create_view, drop_view, rename_table, update, insert, insert_select, delete, truncate, replace, replace_select, delete_multi, update_multi, load, select, call_procedure, connect, disconnect, grant, revoke, revoke_all, show_triggers, show_create_proc, show_create_func, show_procedure_code, show_function_code, show_create_event, show_events, show_create_trigger, show_grants, show_binlog_events, show_relaylog_events

기본값: create_user, alter_user, grant, update
아니요
cloudsql_mysql_audit_data_masking_regex string
max_string_length: 2048
기본값: 여기를 클릭합니다.
아니요
cloudsql_mysql_audit_log_write_period integer
0...5000밀리초
기본값: 500밀리초
아니요
cloudsql_mysql_audit_max_query_length integer
-1...1073741824
기본값: -1
아니요
cloudsql_vector boolean on | off
기본값: off
cloudsql_vector_max_mem_size integer
1073741824...innodb_buffer_pool_size/2
기본값: 1073741824(바이트)
completion_type enumeration
NO_CHAIN(기본값), CHAIN 또는 RELEASE
아니요
concurrent_insert enumeration
NEVER, AUTO(기본값) 또는 ALWAYS
아니요
connect_timeout integer
2 ... 31536000
기본값: 10
아니요
cte_max_recursion_depth integer
0 ... 4294967295
기본값: 1000
아니요
default_authentication_plugin string
mysql_native_password|caching_sha2_password
default_password_lifetime integer 0...65535
기본값: 0
아니요
default_time_zone string
시간대는 시간대 오프셋 및 시간대 이름의 두 가지 방법으로 지정할 수 있습니다. 예를 들어 +00:00은 UTC 시간대인 런던의 시간대 오프셋이고 Europe/London는 시간대 이름입니다.

-12:59~+13:00의 값을 사용하여 시간대 오프셋을 지정합니다. 앞에 0이 와야 합니다.

시간대 이름을 사용하는 경우 일광 절약 시간에 대한 자동 조정이 지원됩니다. 시간대 오프셋을 사용하는 경우 지원되지 않습니다. MySQL용 Cloud SQL이 지원하는 시간대 이름 목록을 참조하세요. 이를 반영하려면 기본 인스턴스와 모든 읽기 복제본에서 이 플래그를 수동으로 업데이트해야 합니다.

Cloud SQL 인스턴스를 다시 시작하지 않고 시간대를 설정하려면 init_connect 플래그와 함께 set time_zone=timezone_offset 또는 timezone_name 명령어를 사용합니다.

default_week_format integer
0 ... 7
기본값: 0
아니요
delay_key_write enumeration
OFF, ON(기본값) 또는 ALL
아니요
disconnect_on_expired_password boolean on | off
기본값: on
div_precision_increment integer
0 ... 30
기본값: 4
아니요
end_markers_in_json boolean
on | off
기본값: off
아니요
eq_range_index_dive_limit integer
0 ... 2147483647
아니요
event_scheduler boolean
on | off

이벤트 스케줄러를 사용하는 경우 활성화 정책이 ALWAYS인 인스턴스를 구성하여 예약된 이벤트가 실행되도록 합니다.

이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

아니요
expire_logs_days integer
0 ... 99
기본값은 0이며 자동으로 삭제되지 않습니다.

이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

아니요
explicit_defaults_for_timestamp boolean
on | off

아니요
flush_time integer
0 ... 31536000
기본값: 0
아니요
foreign_key_checks boolean
on | off
기본값: on

이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

아니요
ft_max_word_len integer
10 ... 252
ft_min_word_len integer
1 ... 16
ft_query_expansion_limit integer
0 ... 1000
ft_stopword_file string
general_log boolean
on | off

일반 로그에 대한 자세한 내용은 섹션을 참조하세요.

아니요
generated_random_password_length integer 5-255
기본값: 20
아니요
group_concat_max_len integer
4 ... 17179869184
아니요
gtid_executed_compression_period integer
0 ... 4294967295
기본(버전 8.0.22 이하): 1000
기본(버전 8.0.23 이상): 0
아니요
histogram_generation_max_mem_size integer
1000000 ... 4294967295
기본값: 20000000
아니요
init_connect string 아니요
innodb_adaptive_hash_index boolean
on | off
아니요
innodb_adaptive_hash_index_parts integer
1 ... 512
innodb_adaptive_max_sleep_delay integer
0 ... 1000000
아니요
innodb_autoextend_increment integer
1 ... 1000
아니요
innodb_autoinc_lock_mode integer
0 ... 2
innodb_buffer_pool_chunk_size integer
1048576 ... (innodb_buffer_pool_size/innodb_buffer_pool_instances)

이 플래그 값은 innodb_buffer_pool_sizeinnodb_buffer_pool_instances에 따라 달라집니다. MySQL은 이러한 두 플래그를 기반으로 innodb_buffer_pool_chunk_size 값을 자동으로 조정할 수 있습니다.

innodb_buffer_pool_dump_pct integer
1 ... 100
기본값: 25
아니요
innodb_buffer_pool_dump_at_shutdown boolean
on | off
아니요
innodb_buffer_pool_dump_now boolean
on | off

이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

아니요
innodb_buffer_pool_instances integer
1 ... 64
innodb_buffer_pool_load_abort boolean
on | off

이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

아니요
innodb_buffer_pool_load_at_startup boolean
on | off
innodb_buffer_pool_load_now boolean
on | off

이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

아니요
innodb_buffer_pool_size integer

MySQL 5.6에 이 플래그를 설정하면 다시 시작해야 합니다. 이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

아니요
innodb_change_buffer_max_size integer
0 ... 50
아니요
innodb_change_buffering string

옵션: none, inserts, deletes, changes, purges, all.

아니요
innodb_checksum_algorithm string

옵션: crc32, strict_crc32, innodb, strict_innod, none, strict_none.

아니요
innodb_cmp_per_index_enabled boolean
on | off
아니요
innodb_commit_concurrency integer
0 ... 1000
innodb_compression_failure_threshold_pct integer
0 ... 100
아니요
innodb_compression_level integer
0 ... 9
아니요
innodb_compression_pad_pct_max integer
0 ... 75
아니요
innodb_concurrency_tickets integer
1 ... 4294967295
아니요
innodb_deadlock_detect boolean
on | off

MySQL 5.78.0에서 지원됩니다.

기본값: on

아니요
innodb_disable_sort_file_cache boolean
on | off
아니요
innodb_doublewrite_batch_size integer
0 ... 256
기본값: 0
innodb_doublewrite_files integer
2 ... 128
innodb_doublewrite_pages integer
4 ... 512
기본값: 64
innodb_file_per_table boolean
on | off

이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

아니요
innodb_fill_factor integer
10 ... 100
아니요
innodb_flush_log_at_timeout double
0.0001... 2700
기본값: 1

MySQL 5.78.0에서 지원됩니다.

이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

아니요
innodb_flush_log_at_trx_commit integer
1, 2
기본값: 1

이 플래그를 사용 설정한 복제본을 승격하면 플래그가 자동으로 삭제되어 승격된 복제본이 기본적으로 완전한 내구성을 갖게 됩니다. 승격된 복제본에 이 플래그를 사용하려면 승격 후 플래그를 복제본으로 업데이트하면 됩니다.

이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

아니요
innodb_flush_neighbors enumeration
0 ... 2

MySQL 5.6, 5.7, 8.0에서 지원됩니다.

기본값:

  • MySQL 5.6: 0
  • MySQL 5.7: 2
  • MySQL 8.0: 2
  • 아니요
    innodb_flush_sync boolean
    on | off
    아니요
    innodb_ft_aux_table string

    이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    innodb_ft_cache_size integer
    1600000 ... 80000000
    innodb_ft_enable_diag_print boolean
    on | off
    아니요
    innodb_ft_enable_stopword boolean
    on | off
    아니요
    innodb_ft_max_token_size integer
    10 ... 252

    MySQL 5.6 이상 버전에서만 지원됩니다.

    innodb_ft_min_token_size integer
    0 ... 16

    MySQL 5.6 이상 버전에서만 지원됩니다.

    innodb_ft_num_word_optimize integer
    1000 ... 10000
    아니요
    innodb_ft_result_cache_limit integer
    1000000 ... 4294967295
    아니요
    innodb_ft_server_stopword_table string

    MySQL 5.6 이상 버전에서만 지원됩니다.

    아니요
    innodb_ft_sort_pll_degree integer
    1 ... 32
    innodb_ft_total_cache_size integer
    32000000 ... 1600000000
    innodb_ft_user_stopword_table string 아니요
    innodb_io_capacity integer
    100 ... 100000
    기본값: 5000

    MySQL 5.6, 5.7, 8.0에서 지원됩니다.

    디스크 성능 구성에 대한 자세한 내용은 성능 요구사항 충족을 위한 디스크 구성에서 E2 VM 테이블을 참조하세요.

    아니요
    innodb_io_capacity_max integer
    100 ... 100000
    기본값: 10000

    MySQL 5.6, 5.7, 8.0에서 지원됩니다.

    디스크 성능 구성에 대한 자세한 내용은 성능 요구사항 충족을 위한 디스크 구성에서 E2 VM 테이블을 참조하세요.

    아니요
    innodb_large_prefix boolean
    on | off

    MySQL 5.6에서만 지원됩니다.

    아니요
    innodb_lock_wait_timeout integer
    1 ... 1073741824
    아니요
    innodb_log_buffer_size integer
    262144 ... 4294967295
    innodb_log_checksums boolean
    on | off
    기본값: on
    아니요
    innodb_log_compressed_pages boolean
    on | off
    기본값: on
    아니요
    innodb_log_file_size integer
    MySQL 5.6: 1048576 ... 274877906944
    MySQL 5.7: 4194304 ... 274877906944
    innodb_log_spin_cpu_abs_lwm integer
    0 ... 4294967295
    기본값: 80
    아니요
    innodb_log_spin_cpu_pct_hwm integer
    0 ... 100
    기본값: 50
    아니요
    innodb_log_wait_for_flush_spin_hwm integer
    0 ... 4294967295
    기본값: 400
    아니요
    innodb_log_write_ahead_size integer
    512 ... 65536
    기본값: 8192
    아니요
    innodb_lru_scan_depth integer
    100 ... 9223372036854775807
    아니요
    innodb_max_dirty_pages_pct float
    0 ... 99.99
    기본값: 90
    아니요
    innodb_max_dirty_pages_pct_lwm float
    0 ... 99.99
    기본값: 10
    아니요
    innodb_max_purge_lag integer
    0 ... 4294967295
    기본값: 0
    아니요
    innodb_max_undo_log_size integer
    10485760 ... 9223372036854775807
    기본값: 1073741824
    아니요
    innodb_max_purge_lag_delay integer
    0 ... 10000000
    기본값: 0
    아니요
    innodb_monitor_disable string 아니요
    innodb_monitor_enable string 아니요
    innodb_monitor_reset string
    counter, module, pattern, all
    아니요
    innodb_monitor_reset_all enumeration
    유효한 값: counter, module, pattern, all
    아니요
    innodb_old_blocks_pct integer
    5 ... 95
    아니요
    innodb_old_blocks_time integer
    0 ... 4294967295
    아니요
    innodb_online_alter_log_max_size integer
    65536 ... 9223372036854775807
    아니요
    innodb_open_files integer
    100 ... 2147483647
    기본값:
    MySQL 5.7: 2000
    MySQL 8.0: 4000
    8.0.28: 아니요
    8.0.27: 예
    innodb_optimize_fulltext_only boolean
    on | off
    아니요
    innodb_page_cleaners integer
    1 ... 64
    MySQL 5.78.0에서 지원됩니다. 기본값: 4. 버전 5.7은 기본값이 32입니다.
    innodb_parallel_read_threads integer
    1 ... 256
    기본값: 4
    아니요
    innodb_print_all_deadlocks boolean
    on | off
    기본값: off
    아니요
    innodb_print_ddl_logs boolean
    on | off
    아니요
    innodb_purge_batch_size integer
    1 ... 5000
    기본값: 300
    아니요
    innodb_purge_rseg_truncate_frequency integer
    1 ... 128
    기본값: 128
    아니요
    innodb_purge_threads 1 ... 32

    MySQL 5.6., 5.7, 8.0에서 지원됨

    기본값은 1입니다.

    innodb_random_read_ahead boolean
    on | off
    아니요
    innodb_read_ahead_threshold integer
    0 ... 64
    아니요
    innodb_read_io_threads integer
    1 ... 64
    innodb_replication_delay integer
    0 ... 4294967295
    아니요
    innodb_rollback_on_timeout boolean
    on | off
    innodb_rollback_segments integer
    1 ... 128
    아니요
    innodb_segment_reserve_factor float
    .03 ... 40
    기본값: 12.5
    아니요
    innodb_sort_buffer_size integer
    65536 ... 67108864
    innodb_spin_wait_delay integer
    MySQL 5.7: 0 ... 1000000
    MySQL 8.0.13 이상: 0 ... 1000
    기본값: 6
    아니요
    innodb_stats_auto_recalc boolean
    on | off
    아니요
    innodb_stats_include_delete_marked boolean
    on | off
    기본값: off
    아니요
    innodb_stats_method enumeration
    nulls_equal | nulls_unequal | nulls_ignored
    아니요
    innodb_stats_on_metadata boolean
    on | off
    아니요
    innodb_stats_persistent boolean
    on | off
    아니요
    innodb_stats_persistent_sample_pages integer
    1 ... 9223372036854775807
    아니요
    innodb_stats_sample_pages integer
    1 ... 9223372036854775807
    아니요
    innodb_stats_transient_sample_pages integer
    1 ... 9223372036854775807
    아니요
    innodb_status_output boolean
    on | off
    아니요
    innodb_status_output_locks boolean
    on | off
    아니요
    innodb_strict_mode boolean
    on | off
    아니요
    innodb_sync_array_size 1 ... 1024

    MySQL 5.6., 5.7, 8.0에서 지원됨

    기본값은 1입니다.

    innodb_sync_spin_loops integer
    0 ... 4294967295
    기본값: 30
    아니요
    innodb_table_locks boolean
    on | off
    기본값: on
    아니요
    innodb_thread_concurrency integer
    0 ... 1000
    아니요
    innodb_thread_sleep_delay integer
    0 ... 1000000
    아니요
    innodb_undo_log_truncate boolean
    on | off
    기본값: on
    아니요
    innodb_use_native_aio boolean
    on | off
    기본값: on
    innodb_write_io_threads integer
    1 ... 64
    interactive_timeout integer
    1 ... 31536000
    아니요
    internal_tmp_disk_storage_engine enumeration
    INNODB | MYISAM
    기본값: INNODB
    이 플래그는 MySQL 5.7에만 사용됩니다.
    아니요
    internal_tmp_mem_storage_engine enumeration
    MEMORY, TempTable
    이 플래그는 MySQL 8.0에서만 사용됩니다.
    아니요
    join_buffer_size integer
    128 ... 9223372036854775807
    아니요
    keep_files_on_create boolean
    on | off
    기본값: off
    아니요
    key_buffer_size integer
    4096 ... 4294967295
    기본값: 8388608
    아니요
    key_cache_age_threshold integer
    100 ... 9223372036854775807
    기본값: 300
    아니요
    key_cache_block_size integer
    512 ... 16384
    기본값: 1024
    아니요
    key_cache_division_limit integer
    1 ... 100
    기본값: 100
    아니요
    lc_times_names string
    en_US | cs_CZ | da_DK | nl_NL | et_EE | fr_FR | de_DE | el_GR | hu_HU | it_IT | ja_JP | ko_KR | no_NO | nb_NO | pl_PL | pt_PT | ro_RO | ru_RU | sr_RS | sk_SK | es_ES | sv_SE | uk_UA
    기본값: en_US
    아니요
    local_infile boolean
    on | off
    아니요
    lock_wait_timeout integer
    1 ... 31536000
    아니요
    log_bin_trust_function_creators boolean
    on | off
    아니요
    log_output set
    FILE | TABLE | NONE
    아니요
    log_error_verbosity integer
    1 ... 3
    기본값:
    MySQL 5.7: 3
    MySQL 8.0: 2
    아니요
    log_queries_not_using_indexes boolean
    on | off
    아니요
    log_slow_admin_statements boolean
    on | off
    기본값: off
    아니요
    log_slow_extra boolean
    on | off
    기본값: off
    아니요
    log_slow_replica_statements boolean
    on | off 기본값: off
    아니요
    log_slow_slave_statements boolean
    on | off 기본값: off
    아니요
    log_throttle_queries_not_using_indexes integer
    0 ... 9223372036854775807
    아니요
    log_timestamps string
    "UTC | SYSTEM"
    기본값: UTC
    아니요
    long_query_time float
    0 ... 30000000

    Cloud SQL에서는 필요한 경우 이 플래그를 1 미만으로 설정할 수 있습니다.

    log_queries_not_using_indexes 플래그도 사용 설정된 경우 여기에 지정된 시간보다 짧은 쿼리가 표시될 수 있습니다.

    아니요
    lower_case_table_names 5.7 | 8.0 integer
    0 또는 1
    기본값: 0

    이 플래그에 기본값 0을 사용하면 테이블과 데이터베이스 이름은 대소문자를 구분합니다. 1로 설정하면 테이블 및 데이터베이스 이름이 대소문자를 구분하지 않습니다.

    MySQL 5.7 인스턴스의 경우 언제든지 이 플래그 값을 변경할 수 있습니다. 이러한 경우 변경사항이 기존 테이블 및 데이터베이스에 미치는 영향을 이해하고 있어야 합니다.

    MySQL 8.0 인스턴스의 경우 인스턴스가 생성되는 동안에만 이 플래그 값을 원하는 값으로 설정할 수 있습니다. 이 값을 설정한 후에는 변경할 수 없습니다. 또한 기존 인스턴스의 경우 이 플래그 값을 변경할 수 없습니다.

    MySQL 5.7 또는 MySQL 8.0 인스턴스의 읽기 복제본을 만들 때 복제본은 기본 인스턴스에서 이 플래그 값을 상속합니다.

    mandatory_roles string role name
    기본값: empty string
    아니요
    master_verify_checksum boolean
    on | off 기본값: off
    아니요
    max_allowed_packet integer
    16384 ... 1073741824

    sql_mode=TRADITIONAL 또는 sql_mode=STRICT_ALL_TABLES인 경우 이 값은 1024의 배수여야 합니다.

    아니요
    max_binlog_cache_size integer
    4096 ... 4294967296
    기본값: 4294967296
    아니요
    max_binlog_size integer
    4096 ... 1073741824
    아니요
    max_binlog_stmt_cache_size integer
    4096 ... 4294967296
    기본값: 4294967296
    아니요
    max_connect_errors integer
    1 ... 9223372036854775807
    기본값: 100
    아니요
    max_connections integer
    1 ... 100000
    아니요
    max_digest_length integer
    0 ... 1048576
    max_error_count integer
    0 ... 65535
    기본값:
    MySQL 5.7 이하: 64
    MySQL 8.0 이상: 1024
    아니요
    max_execution_time integer
    0 ... 9223372036854775807
    아니요
    max_heap_table_size integer
    16384 ... 67108864

    이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    아니요
    max_join_size integer
    16 ... 9223372036854775807
    아니요
    max_length_for_sort_data integer
    4 ... 8388608
    아니요
    max_points_in_geometry integer
    3 ... 1048576
    아니요
    max_prepared_stmt_count integer
    0 ... 1048576
    아니요
    max_seeks_for_key integer
    1 ... 9223372036854775807
    아니요
    max_sort_length integer
    4 ... 8388608
    아니요
    max_sp_recursion_depth integer
    0 ... 255
    아니요
    max_user_connections integer
    0 ... 4294967295
    아니요
    max_write_lock_count integer
    1 ... 9223372036854775807
    아니요
    min_examined_row_limit integer
    0 ... 4294967295
    기본값: 0
    아니요
    myisam_data_pointer_size integer
    2...7
    기본값: 6
    아니요
    myisam_max_sort_file_size integer
    0...9223372036853727232
    기본값: 9223372036853727232
    아니요
    myisam_mmap_size integer
    7...9223372036854775807
    기본값: 9223372036854775807
    myisam_sort_buffer_size integer
    4096...4294967295
    기본값: 8388608
    아니요
    myisam_stats_method string
    "nulls_unequal, nulls_equal, nulls_ignored"
    기본값: nulls_unequal
    아니요
    myisam_use_mmap boolean
    on | off
    기본값: off
    아니요
    mysql_native_password_proxy_users boolean
    on | off
    기본값: off
    아니요
    net_buffer_length integer
    1024 ... 1048576
    기본값: 16384
    아니요
    net_read_timeout integer
    30 ... 4294967295
    아니요
    net_retry_count integer
    10 ... 4294967295
    아니요
    net_write_timeout integer
    60 ... 4294967295
    아니요
    ngram_token_size integer
    1 ... 10
    기본값: 2
    optimizer_prune_level integer
    0 ... 1
    아니요
    optimizer_search_depth integer
    0 ... 62
    아니요
    optimizer_switch multi-value repeated string

    다중 값 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    아니요
    optimizer_trace multi-value repeated string
    enabled=on, enabled=off, one_line=on, one_line=off

    다중 값 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    아니요
    optimizer_trace_features multi-value repeated string

    다중 값 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    아니요
    optimizer_trace_max_mem_size integer
    0 ... 9223372036854775807
    아니요
    optimizer_trace_offset integer
    -9223372036854775808 ... 9223372036854775807
    아니요
    parser_max_mem_size integer
    10000000 ... 9223372036854775807
    아니요
    password_history integer 0-4294967295
    기본값: 0
    아니요
    password_require_current boolean on | off
    기본값: off
    아니요
    password_reuse_interval integer 0-4294967295
    기본값: 0
    아니요
    performance_schema boolean
    on | off

    기본값: off, MySQL 5.6, 5.7, 8.0이며 인스턴스 RAM이 15GB 미만인 경우.

    기본값: on, MySQL 8.0이며 인스턴스 RAM이 15GB를 초과하는 경우

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_accounts_size integer
    -1 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_digests_size integer
    -1 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_error_size integer
    0 ... 1048576
    performance_schema_events_stages_history_long_size integer
    -1 ... 1048576
    performance_schema_events_stages_history_size integer
    -1 ... 1024

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_events_statements_history_long_size integer
    -1 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_events_statements_history_size integer
    -1 ... 1024

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_events_transactions_history_long_size integer
    -1 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_events_transactions_history_size integer
    -1 ... 1024

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_events_waits_history_long_size integer
    -1 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_events_waits_history_size integer
    -1 ... 1024

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_hosts_size integer
    -1 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_cond_classes integer
    0 ... 256

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_cond_instances integer
    -1 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_digest_length integer
    0 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_digest_sample_age integer
    0 ... 1048576
    기본값: 60
    아니요
    performance_schema_max_file_classes integer
    0 ... 256

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_file_handles integer
    0 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_file_instances integer
    -1 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_index_stat integer
    -1 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_memory_classes integer
    0 ... 1024

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_metadata_locks integer
    -1 ... 104857600

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_mutex_classes integer
    0 ... 256

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_mutex_instances integer
    -1 ... 104857600

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_prepared_statements_instances integer
    -1 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_program_instances integer
    -1 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_rwlock_classes integer
    0 ... 256

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_rwlock_instances integer
    -1 ... 104857600

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_socket_classes integer
    0 ... 256

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_socket_instances integer
    -1 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_sql_text_length integer
    0 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_stage_classes integer
    0 ... 256

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_statement_classes integer
    0 ... 256

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_statement_stack integer
    1 ... 256

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_table_handles integer
    -1 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_table_instances integer
    -1 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_table_lock_stat integer
    -1 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_thread_classes integer
    0 ... 256

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_max_thread_instances integer
    -1 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_session_connect_attrs_size integer
    -1 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_setup_actors_size integer
    -1 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_setup_objects_size integer
    -1 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    performance_schema_users_size integer
    -1 ... 1048576

    performance_schema 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    preload_buffer_size integer
    1024 ... 1073741824
    기본값: 32768
    아니요
    query_alloc_block_size integer
    1024 ... 4294967295
    아니요
    query_cache_limit integer
    0 ... 223338299392

    이 플래그는 MySQL 8.0에서 사용할 수 없습니다. 쿼리 캐시가 MySQL 5.7.20부터 지원 중단되었으며 MySQL 8.0에서 제거되었습니다.

    아니요
    query_cache_min_res_unit integer
    0 ... 9223372036854775807

    이 플래그는 MySQL 8.0에서 사용할 수 없습니다. 쿼리 캐시가 MySQL 5.7.20부터 지원 중단되었으며 MySQL 8.0에서 제거되었습니다.

    아니요
    query_cache_size integer
    0 ... 223338299392

    이 플래그는 MySQL 8.0에서 사용할 수 없습니다. 쿼리 캐시가 MySQL 5.7.20부터 지원 중단되었으며 MySQL 8.0에서 제거되었습니다.

    아니요
    query_cache_type enumeration
    0 ... 2

    이 플래그는 MySQL 8.0에서 사용할 수 없습니다. 쿼리 캐시가 MySQL 5.7.20부터 지원 중단되었으며 MySQL 8.0에서 제거되었습니다.

    query_cache_wlock_invalidate boolean
    on | off

    이 플래그는 MySQL 8.0에서 사용할 수 없습니다. 쿼리 캐시가 MySQL 5.7.20부터 지원 중단되었으며 MySQL 8.0에서 제거되었습니다.

    아니요
    query_prealloc_size integer
    8192 ... 9223372036854775807
    아니요
    range_alloc_block_size integer
    4096 ... 4294967295
    아니요
    range_optimizer_max_mem_size integer
    0 ... 9223372036854775807
    아니요
    read_buffer_size integer
    8192 ... 2147483647
    아니요
    read_only boolean
    on | off

    복제본에 영향을 주지 않습니다.

    아니요
    read_rnd_buffer_size integer
    1 ... 2147483647
    아니요
    regexp_stack_limit integer
    0 ... 2147483647
    아니요
    regexp_time_limit integer
    0 ... 2147483647
    기본값: 32
    아니요
    replica_checkpoint_group integer
    32 ... 524280
    기본값은 512입니다.

    이 플래그는 멀티스레딩이 사용 설정되지 않은 복제본에 영향을 주지 않습니다.

    아니요
    replica_checkpoint_period integer
    1 ... 4294967295
    기본값은 300입니다.

    단위는 밀리초입니다.

    아니요
    replica_compressed_protocol boolean
    on | off
    아니요
    replica_net_timeout integer
    1 ... 31536000

    단위는 초입니다.

    아니요
    replica_parallel_type enumeration
    DATABASE, LOGICAL_CLOCK
    기본값:
    MySQL 8.0.26 이하: DATABASE
    MySQL 8.0.27 이하: LOGICAL_CLOCK

    이 플래그 및 허용되는 값을 사용하는 방법에 대한 자세한 내용은 병렬 복제 구성을 참조하세요.

    아니요
    replica_parallel_workers integer

    이 플래그 및 허용되는 값을 사용하는 방법에 대한 자세한 내용은 병렬 복제 구성을 참조하세요.

    아니요
    replica_pending_jobs_size_max integer

    이 플래그 및 허용되는 값을 사용하는 방법에 대한 자세한 내용은 병렬 복제 구성을 참조하세요.

    아니요
    replica_preserve_commit_order boolean

    이 플래그 및 허용되는 값을 사용하는 방법에 대한 자세한 내용은 병렬 복제 구성을 참조하세요.

    아니요
    replica_skip_errors string
    기본값: OFF

    이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    replica_sql_verify_checksum boolean
    on | off
    아니요
    replica_transaction_retries integer
    0 ... 9223372036854775807
    아니요
    replica_type_conversions String
    값: ALL_LOSSY, ALL_NON_LOSSY, ALL_SIGNED, ALL_UNSIGNED
    아니요
    replicate_do_db string

    이 플래그를 사용하는 방법은 복제 필터 섹션을 참조하세요.

    아니요
    replicate_do_table string

    이 플래그를 사용하는 방법은 복제 필터 섹션을 참조하세요.

    아니요
    replicate_ignore_db string

    이 플래그를 사용하는 방법은 복제 필터 섹션을 참조하세요.

    아니요
    replicate_ignore_table string

    이 플래그를 사용하는 방법은 복제 필터 섹션을 참조하세요.

    아니요
    replicate_wild_do_table string

    이 플래그를 사용하는 방법은 복제 필터 섹션을 참조하세요.

    아니요
    replicate_wild_ignore_table string

    이 플래그를 사용하는 방법은 복제 필터 섹션을 참조하세요.

    아니요
    rpl_read_size integer
    8192 ... 4294959104
    기본값: 8192
    아니요
    schema_definition_cache integer
    256 ... 524288
    기본값: 256
    아니요
    session_track_gtids string
    OFF | OWN_GTID | ALL_GTIDS
    기본값: OFF
    아니요
    session_track_schema boolean
    on | off
    기본값: on
    아니요
    session_track_state_change boolean
    on | off
    기본값: off
    아니요
    session_track_transaction_info string
    OFF | STATE | CHARACTERISTICS
    기본값: OFF
    아니요
    sha256_password_proxy_users boolean
    on | off
    기본값: off
    아니요
    show_create_table_verbosity boolean
    on | off
    기본값: off
    아니요
    show_compatibility_56 boolean
    on | off

    MySQL 5.7에서만 지원됩니다.

    아니요
    skip_character_set_client_handshake boolean
    on | off
    기본값: off
    skip_show_database flag
    on | off
    slave_checkpoint_group integer
    32 ... 524280
    기본값은 512입니다.

    이 플래그는 멀티스레딩이 사용 설정되지 않은 복제본에 영향을 주지 않습니다.

    아니요
    slave_checkpoint_period integer
    1 ... 4294967295
    기본값은 300입니다.

    단위는 밀리초입니다.

    아니요
    slave_compressed_protocol boolean
    on | off
    아니요
    slave_net_timeout integer
    1 ... 31536000

    단위는 초입니다.

    아니요
    slave_parallel_type enumeration
    DATABASE, LOGICAL_CLOCK
    기본값:
    MySQL 8.0.26 이하: DATABASE
    MySQL 8.0.27 이하: LOGICAL_CLOCK

    이 플래그 및 허용되는 값을 사용하는 방법에 대한 자세한 내용은 병렬 복제 구성을 참조하세요.

    아니요
    slave_parallel_workers integer

    이 플래그 및 허용되는 값을 사용하는 방법에 대한 자세한 내용은 병렬 복제 구성을 참조하세요.

    아니요
    slave_preserve_commit_order boolean

    이 플래그 및 허용되는 값을 사용하는 방법에 대한 자세한 내용은 병렬 복제 구성을 참조하세요.

    아니요
    slave_pending_jobs_size_max integer

    이 플래그 및 허용되는 값을 사용하는 방법에 대한 자세한 내용은 병렬 복제 구성을 참조하세요.

    아니요
    slave_skip_errors string
    기본값: OFF

    이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    slave_sql_verify_checksum boolean
    on | off
    아니요
    slave_transaction_retries integer
    0 ... 9223372036854775807
    아니요
    slave_type_conversions string
    값: ALL_LOSSY, ALL_NON_LOSSY, ALL_SIGNED, ALL_UNSIGNED
    아니요
    slow_launch_time Integer
    0 ... 31536000
    기본값: 2
    아니요
    slow_query_log boolean
    on | off

    느린 쿼리 로그에 대한 자세한 내용은 섹션을 참조하세요.

    아니요
    sort_buffer_size integer
    32768 ... 9223372036854775807
    아니요
    source_verify_checksum boolean
    on | off
    기본값: off
    아니요
    sql_mode string

    ANSI와 같은 결합 모드를 포함하여 허용되는 값은 MySQL 문서의 서버 SQL 모드를 참조하세요. NO_DIR_IN_CREATE는 지원되지 않습니다.

    MySQL용 Cloud SQL은 sql_mode 플래그에 빈 값을 지원하지 않습니다. 빈 값을 사용하는 대신 이 플래그를 NO_ENGINE_SUBSTITUTION 모드로 설정합니다.

    아니요
    sql_require_primary_key boolean
    on | off
    기본값: off
    아니요
    sql_select_limit integer 0...18446744073709551615
    기본값: 18446744073709551615

    이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    아니요
    stored_program_cache integer
    16 ... 524288
    아니요
    stored_program_definition_cache integer
    256 ... 524288
    기본값: 256
    아니요
    sync_binlog integer
    0 ... 4294967295

    기본 설정인 1은 트랜잭션이 커밋되기 전에 디스크에 바이너리 로그 동기화를 사용 설정합니다.

    이 플래그를 사용 설정한 복제본을 승격하면 플래그가 자동으로 삭제되어 승격된 복제본이 기본적으로 완전한 내구성을 갖게 됩니다. 승격된 복제본에 이 플래그를 사용하려면 승격 후 플래그를 복제본으로 업데이트하면 됩니다.

    이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    아니요
    sync_master_info integer
    0 ... 4294967295
    기본값: 10000
    아니요
    sync_relay_log integer
    0 ... 4294967295
    기본값: 10000
    아니요
    sync_relay_log_info integer
    0 ... 4294967295
    기본값: 10000
    아니요
    sync_source_info integer
    0 ... 4294967295
    기본값: 10000
    아니요
    sysdate_is_now boolean
    on | off
    기본값: off
    table_definition_cache integer
    400 ... 524288
    아니요
    tablespace_definition_cache integer
    256 ... 524288
    기본값: 256
    아니요
    table_open_cache integer
    1 ... 524288
    아니요
    table_open_cache_instances integer
    1 ... 64
    temptable_max_mmap integer
    0 ... 68719476736
    기본값: 1073741824
    아니요
    temptable_max_ram integer
    2097152 ... 68719476736
    기본값: 1073741824
    아니요
    thread_cache_size integer
    0 ... 16384
    아니요
    thread_stack integer
    131072 ... 9223372036854775807
    tls_version String

    버전 5.7~8.0.27: TLSv1, TLSv1.1
    버전 8.0.28 이상: TLSv1.2
    버전 5.7: 예

    버전 8.0 이상: 아니요
    tmp_table_size integer
    1024 ... 67108864

    이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    아니요
    transaction_alloc_block_size integer
    1024 ... 131072
    아니요
    transaction_isolation enumeration
    READ-UNCOMMITTED | READ-COMMITTED | REPEATABLE-READ | SERIALIZABLE
    transaction_prealloc_size integer
    1024 ... 131072
    아니요
    transaction_write_set_extraction enumeration

    이 플래그 및 허용되는 값을 사용하는 방법에 대한 자세한 내용은 병렬 복제 구성을 참조하세요.

    아니요
    unique_checks boolean
    on | off
    기본값: on

    이 플래그에 대한 자세한 내용은 섹션을 참조하세요.

    아니요
    updatable_views_with_limit integer
    0 ... 1
    아니요
    wait_timeout integer
    1 ... 31536000
    아니요
    windowing_use_high_precision boolean
    on | off
    기본값: on
    아니요

    시간대 이름

    이 섹션에서는 MySQL용 Cloud SQL에서 지원되는 시간대 이름에 대해 알아봅니다.

    이 섹션의 표에서는 다음을 보여줍니다.

    • 시간대 이름: MySQL용 Cloud SQL이 지원하는 이름입니다.
    • STD: 표준 시간(STD)의 시간대 오프셋입니다.
    • DST: 일광 절약 시간(DST)의 시간대 오프셋입니다.
    • 동의어 이름: 사용할 시간대 이름이지만 MySQL용 Cloud SQL에서는 지원되지 않습니다. 이 경우 해당 시간대 이름을 사용합니다.
    시간대 이름 STD DST 동의어 이름
    Africa/Cairo +02:00 +02:00 이집트
    Africa/Casablanca +01:00 +00:00
    Africa/Harare +02:00 +02:00 Africa/Maputo
    Africa/Monrovia +00:00 +00:00
    Africa/Nairobi +03:00 +03:00 Africa/Addis_Ababa
    Africa/Asmera
    Africa/Dar_es_Salaam
    Africa/Djibouti
    Africa/Kampala
    Africa/Mogadishu
    Indian/Antananarivo
    Indian/Comoro
    Indian/Mayotte
    Africa/Tripoli +02:00 +02:00 리비아
    Africa/Windhoek +02:00 +02:00
    America/Araguaina −03:00 −03:00
    America/Asuncion −04:00 −03:00
    America/Bogota −05:00 −05:00
    America/Buenos_Aires −03:00 −03:00 America/Argentina/Buenos_Aires
    America/Caracas −04:00 −04:00
    America/Chicago −06:00 −05:00
    America/Chihuahua −07:00 −06:00 America/Ojinaga
    America/Cuiaba −04:00 −04:00
    America/Denver −07:00 −06:00 America/Shiprock
    Navajo
    MST7MDT
    US/Mountain
    America/Detroit −05:00 −04:00
    America/Fortaleza −03:00 −03:00
    America/Guatemala −06:00 −06:00
    America/Halifax −04:00 −03:00 Canada/Atlantic
    America/Los_Angeles −08:00 −07:00
    America/Manaus −04:00 −04:00 Brazil/West
    America/Matamoros −06:00 −05:00
    America/Mexico_City −06:00 −05:00
    America/Monterrey −06:00 −05:00
    America/Montevideo −03:00 −03:00
    America/New_York −05:00 −04:00
    America/Phoenix −07:00 −07:00 US/Arizona
    MST
    America/Creston
    America/Santiago −04:00 −03:00 Chile/Continental
    America/Sao_Paolo −03:00 −03:00
    America/Tijuana −08:00 −07:00 Mexico/BajaNorte
    America/Ensenada
    America/Santa_Isabel
    Asia/Amman +02:00 +03:00
    Asia/Ashgabat +05:00 +05:00 Asia/Ashkhabad
    Asia/Baghdad +03:00 +03:00
    Asia/Baku +04:00 +04:00
    Asia/Bangkok +07:00 +07:00 Asia/Phnom_Penh
    Asia/Vientiane
    Asia/Beirut +02:00 +03:00
    Asia/Calcutta +05:30 +05:30 Asia/Kolkata
    Asia/Damascus +02:00 +03:00
    Asia/Dhaka +06:00 +06:00 Asia/Dacca
    Asia/Irkutsk +08:00 +08:00
    Asia/Jerusalem +02:00 +03:00 Asia/Tel_Aviv
    Israel
    Asia/Kabul +04:30 +04:30
    Asia/Karachi +05:00 +05:00
    Asia/Kathmandu +05:45 +05:45 Asia/Katmandu
    Asia/Kolkata +05:30 +05:30
    Asia/Krasnoyarsk +07:00 +07:00
    Asia/Magadan +11:00 +11:00
    Asia/Muscat +04:00 +04:00 Asia/Dubai
    Asia/Novosibirsk +07:00 +07:00
    Asia/Riyadh +03:00 +03:00 Asia/Kuwait
    Antarctica/Syowa
    Asia/Aden
    Asia/Seoul +09:00 +09:00 ROK
    Asia/Shanghai +08:00 +08:00 Asia/Chongqing
    Asia/Chungking
    Asia/Harbin
    PRC
    Asia/Singapore +08:00 +08:00 싱가포르
    Asia/Taipei +08:00 +08:00 ROC
    Asia/Tehran +03:30 +04:30 이란
    Asia/Tokyo +09:00 +09:00 일본
    Asia/Ulaanbaatar +08:00 +08:00 Asia/Ulan_Bator
    Asia/Vladivostok +10:00 +10:00
    Asia/Yakutsk +09:00 +09:00
    Asia/Yerevan +04:00 +04:00
    Atlantic/Azores −01:00 +00:00
    Australia/Adelaide +09:30 +10:30 Australia/South
    Australia/Brisbane +10:00 +10:00 Australia/Queensland
    Australia/Darwin +09:30 +09:30 Australia/North
    Australia/Hobart +10:00 +11:00 Australia/Currie
    Australia/Tasmania
    Australia/Perth +08:00 +08:00 Australia/West
    Australia/Sydney +10:00 +11:00 Australia/NSW
    Australia/ACT
    Australia/Canberra
    Brazil/East −03:00 −03:00 America/Sao_Paulo
    Canada/Newfoundland −03:30 −02:30 America/St_Johns
    Canada/Saskatchewan −06:00 −06:00 America/Regina
    Canada/Yukon −07:00 −07:00 America/Whitehorse
    Europe/Amsterdam +01:00 +02:00
    Europe/Athens +02:00 +03:00
    Europe/Dublin +01:00 +00:00 Eire
    Europe/Helsinki +02:00 +03:00 Europe/Mariehamn
    Europe/Istanbul +03:00 +03:00 Turkey
    Asia/Istanbul
    Europe/Kaliningrad +02:00 +02:00
    Europe/Madrid +01:00 +02:00
    Europe/Moscow +03:00 +03:00 W-SU
    Europe/Paris +01:00 +02:00 MET
    CET
    Europe/Prague +01:00 +02:00 Europe/Bratislava
    Europe/Sarajevo +01:00 +02:00 Europe/Belgrade
    Europe/Ljubljana
    Europe/Podgorica
    Europe/Skopje
    Europe/Zagreb
    Pacific/Auckland +12:00 +13:00 NZ
    Antarctica/McMurdo
    Antarctica/South_Pole
    Pacific/Fiji +12:00 +13:00
    Pacific/Guam +10:00 +10:00 Pacific/Saipan
    Pacific/Honolulu −10:00 −10:00 US/Hawaii
    Pacific/Johnston
    HST
    Pacific/Samoa −11:00 −11:00 Pacific/Pago_Pago
    US/Samoa
    US/Alaska −09:00 −08:00 America/Anchorage
    America/Juneau
    America/Metlakatla
    America/Nome
    America/Sitka
    America/Yakutat
    US/Central −06:00 −05:00 America/Chicago
    US/Eastern −05:00 −04:00 America/New_York
    US/East-Indiana −05:00 −04:00 America/Indiana/Indianapolis
    America/Indianapolis
    America/Fort_Wayne
    US/Mountain −07:00 −06:00 America/Denver
    US/Pacific −08:00 −07:00 America/Los_Angeles
    UTC +00:00 +00:00 Etc/UTC
    Etc/UCT
    Etc/Universal
    Etc/Zulu

    Cloud SQL의 시간대 테이블은 최신 데이터로 새로고침해야 할 수 있습니다. 예를 들어 국가가 DST 시간대 오프셋에서 STD 오프셋으로 전환하거나 국가에서 다른 시간대를 도입할 수 있습니다.

    Cloud SQL의 모든 중요 서비스 에이전트(CSA) 출시마다 시간대 테이블이 최신 데이터로 새로고침됩니다. 이 경우 비유지보수 기간 동안 복제본 인스턴스가 새로고침됩니다. 그러면 기본 인스턴스가 유지보수 기간 중에 새로고침됩니다.

    CSA 출시의 정기 유지보수 기간까지 기다리거나 셀프서비스 유지보수를 수행하여 시간대 테이블을 최신 데이터로 새로고침할 수 있습니다. 사용 가능한 유지보수 버전 보기에 대한 자세한 내용은 대상 유지보수 버전 확인을 참조하세요.

    플래그 작업 도움말

    general_log, slow_query_log

    general 또는 slow query 로그를 사용하려면 해당 플래그를 사용 설정하고 log_output 플래그를 FILE로 설정합니다. 이렇게 하면 Google Cloud 콘솔의 로그 뷰어를 사용하여 로그를 출력할 수 있습니다. Google Cloud Observability 로깅 요금이 적용됩니다. 인스턴스 스토리지 비용을 최소화하기 위해 로그 파일이 24시간(그리고 이 기간 동안 변경사항이 없는 경우) 또는 100MB를 초과하면 인스턴스 디스크의 generalslow query 로그가 순환됩니다. 이전 로그 파일은 순환 후에 자동으로 삭제됩니다.

    log_outputNONE으로 설정된 경우 로그에 액세스할 수 없습니다. log_outputTABLE로 설정하면 로그 출력이 mysql 시스템 데이터베이스의 테이블에 배치됩니다. 이는 상당량의 디스크 공간을 소비할 수 있습니다. 이 테이블이 커지면 인스턴스 재시작 시간에 영향을 주거나 인스턴스에 SLA가 적용되지 않을 수 있습니다. 이러한 이유로 TABLE 옵션은 권장되지 않습니다. 또한 로그 콘텐츠는 로그 탐색기에서 제공되지 않으며 순환되지 않습니다. 필요한 경우 API를 사용하여 로그 테이블을 자를 수 있습니다. 자세한 내용은 instances.truncateLog 참조 페이지를 확인하세요.

    expire_logs_days, binlog_expire_logs_seconds
    PITR(point-in-time recovery)를 사용 설정하면 트랜잭션 로그 보관 기간과 이러한 플래그의 값 중 더 작은 값에 따라 바이너리 로그의 만료 기간이 결정됩니다. 이러한 플래그를 사용하여 바이너리 로그가 복제본에 저장되는 기간을 관리할 수 있습니다. 자세한 내용은 트랜잭션 로그 보관 페이지를 참조하세요.
    innodb_buffer_pool_size

    innodb_buffer_pool_size 값은 버퍼 풀 크기(바이트)입니다. RAM이 3,840MiB 미만인 인스턴스에는 이 플래그를 사용 설정할 수 없습니다.

    공유 코어 머신 유형(f1_micro 및 g1_small)에는 이 플래그를 구성할 수 없습니다. MySQL 5.6에서 이 플래그를 변경하려면 다시 시작해야 합니다.

    Cloud SQL에서 innodb_buffer_pool_size 플래그의 기본값, 최소 허용 값, 최대 허용 값은 인스턴스의 메모리에 따라 다릅니다. 이러한 값은 인스턴스 RAM의 백분율로 대략 계산될 수 있습니다. 기본적으로 이 플래그 값은 일반적으로 최대 허용 값에 가깝게 설정됩니다. 인스턴스 크기에 따라 허용되는 최대 할당 비율이 증가합니다. 최소 허용 값은 일반적으로 인스턴스 RAM의 약 20%입니다.

    이 플래그의 대략적인 값:

    인스턴스 RAM 범위최소 %기본 %최대 %
    RAM 0 - 4.0GB~34%
    4.0GB - 7.5GB~20%~34%~34%
    7.5GB - 12GB~20%~52%~52%
    12GB - 24GB~20%~67%~67%
    24GB 이상~20%~72%~72%

    정확한 값은 다를 수 있습니다. 인스턴스의 현재 값을 계산하려면 쿼리를 실행하면 됩니다.

      show global variables like 'innodb_buffer_pool_size';
      

    참고로 다음 머신 유형에 허용되는 최솟값, 기본값, 최댓값이 제공됩니다.

    머신 유형 인스턴스 RAM(GB) 최소(GB)
    (전체 대비 %)
    기본값(GB)
    (전체 대비 %)
    최대(GB)
    (전체 대비 %)
    db-f1-micro 0.6 - 0.053 -
    db-g1-small 1.7 - 0.625 -
    db-custom-1-3840 3.75 0.875
    (23%)
    1.375
    (37%)
    1.375
    (37%)
    db-custom-2-7680 7.5 1.5
    (20%)
    4
    (53%)
    4
    (53%)
    db-custom-4-15360 15 3
    (20%)
    10.5
    (70%)
    10.5
    (70%)
    db-custom-8-30720 30 6
    (20%)
    22
    (73%)
    22
    (73%)
    db-custom-16-61440 60 12
    (20%)
    44
    (73%)
    44
    (73%)
    db-custom-32-122880 120 24
    (20%)
    87
    (73%)
    87
    (73%)
    db-custom-64-245760 240 48
    (20%)
    173
    (72%)
    173
    (72%)
    db-custom-96-368640 360 72
    (20%)
    260
    (72%)
    260
    (72%)
    db-custom-2-13312 13 3
    (23%)
    9
    (69%)
    9
    (69%)
    db-custom-4-26624 26 6
    (23%)
    19
    (73%)
    19
    (73%)
    db-custom-8-53248 52 11
    (21%)
    38
    (73%)
    38
    (73%)
    db-custom-16-106496 104 21
    (20%)
    75
    (72%)
    75
    (72%)
    db-custom-32-212992 208 42
    (20%)
    150
    (72%)
    150
    (72%)
    db-custom-64-425984 416 84
    (20%)
    300
    (72%)
    300
    (72%)
    db-custom-96-638976 624 125
    (20%)
    450
    (72%)
    450
    (72%)

    innodb_file_per_table

    모든 MySQL 버전 5.6 이상에서 기본값은 ON입니다.

    innodb_flush_log_at_trx_commit, sync_binlog
    ACID 전체 규정 준수와 복제 설정의 내구성과 일관성을 유지하려면 innodb_flush_log_at_trx_commitsync_binlog 플래그를 기본값 1로 설정해야 합니다. 기본값을 변경하면 내구성이 감소하여 기본 인스턴스와 복제본 간에 불일치가 발생할 수 있습니다. 따라서 인스턴스에 SLA가 적용되지 않습니다. 또한 다음 중 하나가 발생할 수 있습니다.
    • 리전별 HA 인스턴스의 VM 비정상 종료 또는 장애 조치와 같은 특정 상황에서 데이터 손실
    • 바이너리 로그 및 InnoDB 데이터 파일의 데이터가 동기화되지 않음
    • PITR 데이터 손실 또는 실패
    • 기본 인스턴스와 복제본 인스턴스 간의 데이터 불일치
    • 복제 중단

    innodb_flush_log_at_trx_commit 또는 sync_binlog 플래그의 값을 기본, 독립형, HA 인스턴스의 기본값이 아닌 값으로 설정하면 내구성이 저하됩니다.

    읽기 복제본에 더 높은 성능이 필요한 경우 innodb_flush_log_at_trx_commit 값을 2로 설정하는 것이 좋습니다. Cloud SQL은 이 플래그의 값을 0으로 설정할 수 없습니다. 플래그 값을 2로 설정하면 복제본에서 바이너리 로그를 사용 중지하거나 sync_binlog를 성능 향상을 위해 1이 아닌 다른 값으로 설정해야 합니다.

    백업을 수행할 때 Cloud SQL에서 innodb_flush_log_at_trx_commitsync_binlog 플래그 값을 일시적으로 기본값으로 변경할 수 있습니다. 이로 인해 백업을 수행할 때 성능이 저하될 수 있습니다. 인스턴스에 영향을 주지 않도록 하려면 인스턴스 사용량이 적을 때 백업 기간을 변경하면 됩니다. 자세한 내용은 주문형 백업과 자동 백업 만들기 및 관리를 참조하세요.

    innodb_flush_log_at_timeout

    innodb_flush_log_at_timeout을 사용하면 페이지 플러시 실행 빈도를 수정할 수 있으므로 바이너리 로그 그룹 커밋의 성능에 영향을 주지 않습니다. 기본 설정은 초당 1회입니다.

    Cloud SQL은 기간을 마이크로초 단위로 지정할 수 있도록 이 플래그를 확장했습니다.

    예:

    • 0.001: 1밀리초 지정
    • 0.0001: 100마이크로초 지정
    • 12.5: 12.5초 지정
    • 12.005: 12초 5밀리초 지정
    • 0.005100: 5밀리초 100마이크로초 지정

    특정 워크로드에서는 페이지를 플러시하기 위해 전체 초 단위를 사용하는 것이 잠재적인 트랜잭션 손실 측면에서 허용되지 않을 수 있습니다. 대신 마이크로초 단위로 페이지를 플러시하면 내구성을 크게 떨어뜨리지 않고도 성능을 유지할 수 있습니다.

    innodb_flush_log_at_timeout 플래그의 마이크로초 기간은 innodb_flush_log_at_trx_commit 내구성 플래그가 2로 설정된 경우에만 적용됩니다.

    페이지의 플러시 실행 빈도가 innodb_flush_log_at_timeout에 지정된 값보다 많거나 적을 수 있으며 이 값이 상한이 아닙니다.

    max_heap_table_size, tmp_table_size

    tmp_table_sizemax_heap_table_size를 인스턴스가 처리하는 동시 실행 쿼리 수보다 너무 높게 설정하면 사용 가능한 인스턴스 메모리가 소진될 수 있습니다. 메모리가 소진되면 인스턴스가 비정상적으로 종료되며 다시 시작됩니다.

    이러한 플래그의 사용 방법에 대한 자세한 내용은 MySQL의 내부 임시 테이블 사용법MEMORY 스토리지 엔진을 참조하세요.

    performance_schema

    RAM이 15,360MiB 미만인 인스턴스에서 이 플래그를 사용 설정할 수 없습니다. 이 플래그를 사용 설정하면 머신 유형을 플래그를 지원하지 않는 크기로 변경할 수 없습니다. 이 플래그를 먼저 중지해야 합니다.

    event_scheduler
    MySQL 이벤트(예약된 이벤트라고도 함)는 예약할 수 있는 태스크입니다. 예약된 이벤트는 지정된 간격 하나 이상에서 실행되도록 설정된 SQL 문 하나 이상의 그룹입니다. MySQL 5.7의 기본값은 OFF이고 MySQL 8.0의 기본값은 ON입니다. event_scheduler 플래그에 대한 자세한 내용은 event_scheduler를 참조하세요. 읽기 복제본에서 event_scheduler 플래그가 ON으로 설정되면 이벤트에 정의된 문 유형에 따라 오류가 발생할 수 있습니다.
    • 예약된 이벤트가 읽기 복제본의 write 이벤트인 경우 읽기 복제본이 읽기 전용이므로 오류가 발생합니다. 자세한 내용은 읽기 복제본을 참조하세요.
    • 예약된 이벤트에 kill과 같은 중지 작업이 포함된 경우 event_scheduler에서 이를 복제본에 적용합니다. 그러면 복제가 중지되고 복제본이 삭제됩니다.
    이러한 오류를 방지하려면 복제본을 만들 때 event_scheduler 플래그를 OFF로 설정합니다.

    event_scheduler를 사용 설정 또는 중지하는 방법에 대한 자세한 내용은 데이터베이스 플래그 구성을 참조하세요.

    replica_skip_errors,slave_skip_errors
    replica_skip_errors 또는 slave_skip_errors 플래그를 설정하면 복제 문제가 발생할 수 있습니다. 일반적으로 문 실행 중에 오류가 발생하면 복제가 중지됩니다. 이 플래그를 사용하면 오류를 건너뛰고 복제가 계속 진행되어 기본 인스턴스와 복제본 간의 불일치가 발생합니다. 또한 복제 문제를 해결하기가 더 어려워질 수 있습니다.

    Cloud SQL에서는 필요한 경우에만 이 플래그를 사용하는 것이 좋습니다. 복제 오류가 발생하면 Cloud SQL 문제 해결: 복제에서 이 문제를 해결하는 방법을 참조하세요.

    character_set_client
    character_set_connection
    character_set_results
    collation_connection
    innodb_buffer_pool_dump_now
    innodb_buffer_pool_load_abort
    innodb_buffer_pool_load_now
    innodb_ft_aux_table
    foreign_key_checks
    sql_select_limit
    unique_checks
    이러한 플래그는 Google Cloud 콘솔 또는 gcloud CLI를 사용하여 직접 선택할 수 없습니다. 이러한 플래그를 사용하려면 다음 명령어를 사용합니다.

    SET GLOBAL FLAG_NAME=FLAG_VALUE
    

    SET GLOBAL 명령어를 사용하려면 cloudsqlsuperuser 역할에 부여되는 CLOUDSQL_SPECIAL_SYSEM_VARIABLES_ADMIN 권한이 필요합니다.

    특정 사용자에 대해 특별한 권한 액세스를 부여하는 방법은 MySQL 사용자 정보를 참조하세요. 이러한 플래그는 유지되지 않습니다. Cloud SQL 인스턴스를 다시 만들거나 재시작하면 플래그 설정이 다시 기본값으로 재설정됩니다.

    binlog_order_commits

    binlog_order_commits 플래그의 기본값은 ON입니다. Cloud SQL에서는 이 플래그의 기본값을 변경하지 않는 것이 좋습니다. 기본값이 OFF로 변경되면 동일한 바이너리 로그 그룹에 있는 트랜잭션이 바이너리 로그에 기록될 때와 다른 순서로 커밋됩니다. 이는 바이너리 로그 순서로 트랜잭션을 실행하는 다음 작업에 영향을 미칩니다.

    • 복제: 소스와 복제본 간의 데이터 불일치가 발생할 수 있음
    • Point-in-time-recovery: PITR 복원된 상태와 이전 상태 간의 데이터 불일치가 발생할 수 있습니다.

    optimizer_switch,optimizer_trace,optimizer_trace_features

    최적화 도구 플래그에는 쉼표로 구분된 값이 있습니다. 콘솔 또는 gcloud를 사용하여 이러한 플래그를 설정할 수 있습니다. 콘솔을 사용하여 이 플래그를 설정하는 방법에 대한 자세한 내용은 데이터베이스 플래그 구성을 참조하세요. gcloud를 사용하는 경우 다음 두 가지 방법으로 이러한 플래그 값을 지정할 수 있습니다.

    한 명령어에 여러 최적화 도구 하위 플래그를 설정하려면 쉼표 구분 기호를 사용하여 각 플래그 이름을 구분합니다. gcloud 명령어를 사용하여 단일 하위 플래그 값을 설정하면 이전에 설정한 모든 하위 플래그를 덮어씁니다. 예를 들어 다음 명령어를 실행하면 batched_key_access 하위 플래그의 예상 값은 on으로 설정되고 optimizer_flags의 다른 모든 하위 플래그가 기본값으로 설정됩니다.
    gcloud sql instances patch my-instance --database-flags=^~^optimizer_switch=batched_key_access=on
    
    다음 명령어를 실행하면 block_nested_loop 하위 플래그의 값이 on으로 설정되고 optimizer_switch에 대한 다른 모든 하위 플래그가 덮어쓰기되고 기본값으로 설정됩니다.
    gcloud sql instances patch my-instance --database-flags=^~^optimizer_switch=block_nested_loop=on
    
    여기에는 이전 명령어에서 on으로 설정된 batched_key_access가 포함됩니다. 이전에 설정한 모든 하위 플래그를 유지하고 새 플래그를 추가하려면 새 하위 플래그를 추가할 때 설정할 모든 하위 플래그의 값을 추가해야 합니다.

    Cloud SQL에서 변경된 시스템 플래그

    지원되는 플래그 섹션에 나열되지 않은 다른 모든 데이터베이스 시스템을 관리형 플래그라고 부릅니다. 특정 관리형 플래그의 경우 Cloud SQL은 Cloud SQL 인스턴스가 안정적으로 실행될 수 있도록 기본 설정 이외의 값으로 플래그를 설정합니다. 이러한 시스템 플래그에서는 값을 변경할 수 없습니다.

    기본값이 아닌 설정의 관리형 플래그가 아래에 나열되어 있습니다.

    변수 이름 Cloud SQL의 설정 참고
    binlog_format ROW MySQL 5.6에서만 다름
    binlog_error_action ABORT_SERVER MySQL 5.6에서만 다름
    innodb_doublewrite_pages 64 MySQL 8.0.26 이상에 적용
    innodb_file_format Barracuda MySQL 5.6에서만 다름
    innodb_flush_method O_DIRECT
    memlock
    skip_name_resolve ON
    relay_log_info_repository 테이블
    relay_log_recovery ON
    master_info_repository 테이블
    rpl_semi_sync_master_enabled 1
    rpl_semi_sync_master_timeout 3000
    admin_address 127.0.0.1 MySQL 8.0에서만 다름
    create_admin_listener_thread ON
    port-open-timeout 120 MySQL 8.0에서만 다름
    partial_revokes ON MySQL 8.0만 해당. 이 플래그에 대한 자세한 내용은 MySQL 8.0에서 시스템 플래그 부분 취소를 참조하세요.

    MySQL 8.0의 part_revokes 시스템 플래그

    partial_revokes 플래그를 사용하면 데이터베이스 스키마에 대한 사용자 액세스를 제한할 수 있습니다. MySQL용 Cloud SQL 버전 8.0에서 partial_revokes 플래그는 ON으로 설정됩니다. 이렇게 하면 MySQL 8.0의 데이터베이스 스키마에 대한 사용자 권한을 부여하거나 취소할 때 와일드 카드 문자의 사용이 제한됩니다. 와일드 카드 문자를 사용하는 대신 데이터베이스 스키마의 전체 이름을 사용하도록 GRANT 문을 업데이트합니다.

    예를 들어 다음 명령어를 %\ 와일드 카드 문자와 함께 사용하여 MySQL 5.7의 사용자에게 권한을 부여하면 사용자에게 _foobar로 끝나는 모든 데이터베이스에 대한 권한이 부여됩니다.

    GRANT ALL PRIVILEGES ON `%\_foobar`.*  TO  'testuser'@'%';
    

    그러나 MySQL 8.0에서는 사용자에게 %\_foobar과 정확하게 일치하는 데이터베이스에 대한 액세스 권한만 부여됩니다.

    MySQL 8.0의 여러 데이터베이스에 대한 액세스 권한을 부여하는 방법은 두 가지입니다.

    1. 아래 명령어에 표시된 것처럼 전체 데이터베이스 이름을 사용하여 특정 데이터베이스에 권한을 부여할 수 있습니다.

        grant select on test1_foobar.* to 'testuser'@'%';
        grant select on test2_foobar.* to 'testuser'@'%';
        grant select on test3_foobar.* to 'testuser'@'%';
      
    2. partial_revokes를 사용하면 grantrevoke 명령어를 사용하여 모든 데이터베이스 스키마에 대한 권한을 부여하고 일부 데이터베이스 스키마에 대한 액세스를 제한할 수 있습니다.

        grant select on *.* to 'testuser'@'%';
        revoke select on test3_foobar.* from 'testuser'@'%';
      

      모든 데이터베이스 스키마에 대한 액세스를 부여하고 test3_foobar.*에 대한 액세스를 제한합니다.

    복제 필터

    복제 필터는 Cloud SQL 복제본에서만 설정할 수 있습니다. 각 복제 필터는 각 데이터베이스 이름이 쉼표로 구분되는 여러 데이터베이스에 대한 단일 플래그로 설정됩니다. 콘솔 또는 다음 명령어를 사용하여 Cloud SQL 복제본에 복제 필터를 설정할 수 있습니다.

    gcloud sql instances patch REPLICA_NAME --database-flags=^~^REPLICATION_FILTER_NAME=DATABASE_NAME1,DATABASE_NAME, etc
    

    복제 필터는 쉼표 값이 포함된 데이터베이스 이름을 지원하지 않습니다. 이전 명령어의 ^~^ 값은 쉼표로 구분된 값인 데이터베이스 플래그에 필요합니다.

    복제 필터 플래그를 설정할 때 다음에 주의하세요.

    • 복제본이 비정상이 되면 Cloud SQL이 기본 인스턴스의 소스 데이터를 사용하여 인스턴스 복제본을 다시 빌드하면서 복제 필터로 필터링된 데이터가 복제본에 나타날 수 있습니다.
    • mysql 스키마에는 복제 필터를 설정할 수 없습니다.
    • 복제 필터 규칙은 서버리스 내보내기에 적용되지 않습니다.

    색인 자문 플래그

    다음은 MySQL용 Cloud SQL가 색인 자문과 관련된 기능을 사용 설정하고 관리하기 위해 사용하는 데이터베이스 플래그 목록입니다.

    플래그 이름 유형
    허용 값 및 참고 사항
    다시 시작
    필요 여부
    cloudsql_index_advisor boolean
    on | off
    기본값: off
    cloudsql_index_advisor_auto_advisor_schedule string
    기본값: 00:00
    아니요
    cloudsql_index_advisor_run_at_timestamp Datetime
    기본값: 00:00:00
    아니요

    별칭이 지정된 플래그

    아래 목록에는 MySQL용 Cloud SQL 버전 8.0.26 이상에서 변경된 플래그 이름이 포함되어 있습니다.

    지원 중단된 플래그 이름 새 플래그 이름
    log_slow_slave_statements log_slow_replica_statements
    master_verify_checksum source_verify_checksum
    slave_checkpoint_group replica_checkpoint_group
    slave_checkpoint_period replica_checkpoint_period
    slave_compressed_protocol replica_compressed_protocol
    slave_net_timeout replica_net_timeout
    slave_parallel_type replica_parallel_type
    slave_parallel_workers replica_parallel_workers
    slave_pending_jobs_size_max replica_pending_jobs_size_max
    slave_preserve_commit_order replica_preserve_commit_order
    slave_skip_errors replica_skip_errors
    slave_sql_verify_checksum replica_sql_verify_checksum
    slave_transaction_retries replica_transaction_retries
    slave_type_conversions replica_type_conversions
    sync_master_info sync_source_info

    Cloud SQL 인스턴스에 지원 중단된 플래그 이름이 사용되는 경우 Cloud SQL 인스턴스를 수정하고 지원 중단된 플래그 이름을 삭제하고 인스턴스에 새 플래그를 추가합니다. 자세한 내용은 데이터베이스 플래그 설정을 참조하세요.

    문제 해결

    문제 문제 해결
    플래그를 사용 설정한 후 인스턴스가 공황과 비정상 종료 간에 순환됩니다. 고객지원에 연락하여 플래그 삭제 후 hard drain을 요청합니다. 이렇게 하면 원하지 않는 플래그 또는 설정 없이 새 구성으로 인스턴스가 다른 호스트에서 강제로 다시 시작됩니다.
    플래그를 설정하려고 하면 오류 메시지 Bad syntax for dict arg가 표시됩니다. 쉼표로 구분된 목록과 같은 복잡한 매개변수 값은 gcloud 명령어에 사용할 때 특수 처리되어야 합니다.

    다음 단계