Loading...
MySQL 9.5 Reference Manual 9.5의 6.5.3 mysqlcheck — A Table Maintenance Program의 한국어 번역본입니다.
아래의 경우에 피드백에서 신고해주신다면 반영하겠습니다.
감사합니다 :)
mysqlcheck client는 table 유지 관리를 수행합니다. 즉, table을 검사(check), 복구(repair), 최적화(optimize), 분석(analyze)합니다.
각 table은 처리되는 동안 lock이 걸리며, 따라서 다른 session에서는 사용할 수 없습니다. 단, check 작업의 경우에는 table이 READ lock만으로 lock됩니다( READ 및 WRITE lock에 대한 자세한 내용은
Section 15.3.6, “LOCK TABLES and UNLOCK TABLES Statements”을 참조하십시오).
Table 유지 관리 작업은 특히 큰 table의 경우 시간이 오래 걸릴 수 있습니다. --databases 또는
--all-databases 옵션을 사용하여 하나 이상의 database의 모든 table을 처리하도록 하면,
mysqlcheck 호출에 오랜 시간이 걸릴 수 있습니다.
(MySQL upgrade 절차에서도 table을 동일한 방식으로 처리하기 때문에, table 검사가 필요하다고 판단되는 경우 마찬가지입니다.)
mysqlcheck는 mysqld server가 실행 중일 때 사용해야 하므로, table 유지 관리를 수행하기 위해 server를 중지할 필요가 없습니다.
mysqlcheck는 사용자에게 편리한 방식으로 SQL statement
CHECK TABLE,
REPAIR TABLE,
ANALYZE TABLE,
OPTIMIZE TABLE를 사용합니다. 사용자가 수행하려는 작업에 대해 어떤 statement를 사용할지를 결정한 다음, 해당 statement를 server로 전송하여 실행하게 합니다.
각 statement가 어떤 storage engine과 함께 동작하는지에 대한 자세한 내용은
Section 15.7.3, “Table Maintenance Statements”의 해당 statement 설명을 참조하십시오.
모든 storage engine이 네 가지 유지 관리 작업을 모두 지원하는 것은 아닙니다. 이러한 경우에는 error message가 표시됩니다. 예를 들어, test.t가
MEMORY table인 경우, 이를 검사하려고 시도하면 다음과 같은 결과가 발생합니다:
1$> mysqlcheck test t 2test.t 3note : The storage engine for the table doesn't support check
mysqlcheck로 table을 복구할 수 없는 경우, 수동 table 복구 전략은
Section 3.14, “Rebuilding or Repairing Tables or Indexes”를 참조하십시오. 예를 들어, InnoDB table의 경우
CHECK TABLE로는 검사할 수 있지만,
REPAIR TABLE로는 복구할 수 없습니다.
주의
Table 복구 작업을 수행하기 전에 table backup을 만드는 것이 가장 좋습니다. 특정 상황에서는 복구 작업으로 인해 data가 손실될 수 있습니다. 가능한 원인에는 file system error 등이 포함되지만, 이에 국한되지는 않습니다.
mysqlcheck를 호출하는 일반적인 방법은 세 가지입니다:
1mysqlcheck [options] db_name [tbl_name ...] 2mysqlcheck [options] --databases db_name ... 3mysqlcheck [options] --all-databases
db_name 뒤에 어떤 table도 지정하지 않거나,
--databases 또는
--all-databases 옵션을 사용하면, database 전체가 검사됩니다.
mysqlcheck는 다른 client program과 비교했을 때 특별한 기능을 하나 가지고 있습니다. Table을 검사하는 기본 동작(
--check)은 binary 이름을 변경하여 바꿀 수 있습니다.
기본적으로 table을 복구하는 tool이 필요하다면,
mysqlcheck의 복사본을 만들어 이름을 mysqlrepair로 지정하거나,
mysqlcheck에 대한 symbolic link를 mysqlrepair라는 이름으로 만들면 됩니다. mysqlrepair를 호출하면 table을 복구합니다.
다음 table에 표시된 이름은 mysqlcheck의 기본 동작을 변경하는 데 사용할 수 있습니다.
| Command | Meaning |
|---|---|
| mysqlrepair | 기본 옵션은 --repair입니다 |
| mysqlanalyze | 기본 옵션은 --analyze입니다 |
| mysqloptimize | 기본 옵션은 --optimize입니다 |
mysqlcheck는 다음과 같은 옵션을 지원합니다. 이 옵션들은 command line 또는 option file의
[mysqlcheck] 및 [client] group에 지정할 수 있습니다. MySQL program에서 사용하는 option file에 대한 정보는
Section 6.2.2.2, “Using Option Files”를 참조하십시오.
Table 6.12 mysqlcheck Options
| Option Name | Description |
|---|---|
| --all-databases | 모든 database의 모든 table을 검사합니다 |
| --all-in-1 | 각 database에 대해, 해당 database의 모든 table을 나열하는 단일 statement를 실행합니다 |
| --analyze | Table을 분석합니다 |
| --auto-repair | 검사된 table이 손상된 경우 자동으로 복구합니다 |
| --bind-address | MySQL Server에 연결하기 위해 사용할 네트워크 인터페이스를 지정합니다 |
| --character-sets-dir | 문자 집합이 설치된 디렉터리 |
| --check | Table에 error가 있는지 검사합니다 |
| --check-only-changed | 마지막 검사 이후 변경되었거나 제대로 close되지 않은 table만 검사합니다 |
| --check-upgrade | CHECK TABLE을 FOR UPGRADE 옵션과 함께 호출합니다 |
| --compress | Client와 server 간에 전송되는 모든 정보를 가능한 경우 압축합니다 |
| --compression-algorithms | Server 연결에 허용되는 압축 알고리즘 |
| --databases | 모든 argument를 database 이름으로 해석합니다 |
| --debug | 디버그 로그를 기록합니다 |
| --debug-check | Program 종료 시 디버그 정보를 출력합니다 |
| --debug-info | Program 종료 시 디버그 정보와 메모리 및 CPU 통계를 출력합니다 |
| --default-character-set | 기본 문자 집합을 지정합니다 |
| --defaults-extra-file | 일반적인 option file에 더해 지정한 option file을 읽습니다 |
| --defaults-file | 지정한 option file만 읽습니다 |
| --defaults-group-suffix | Option group suffix 값 |
| --enable-cleartext-plugin | Cleartext authentication plugin을 활성화합니다 |
| --extended | Table을 검사하고 복구합니다 |
| --fast | 제대로 close되지 않은 table만 검사합니다 |
| --force | SQL error가 발생해도 계속 수행합니다 |
| --get-server-public-key | Server에서 RSA public key를 요청합니다 |
| --help | 도움말 메시지를 표시하고 종료합니다 |
| --host | MySQL server가 위치한 호스트 |
| --login-path | .mylogin.cnf에서 login path 옵션을 읽습니다 |
| --medium-check | --extended 작업보다 빠른 검사 수행 |
| --no-defaults | 어떤 option file도 읽지 않습니다 |
| --no-login-paths | Login path file에서 login path를 읽지 않습니다 |
| --optimize | Table을 최적화합니다 |
| --password | Server에 연결할 때 사용할 password |
| --password1 | 다단계 인증 factor 1에 사용할 password |
| --password2 | 다단계 인증 factor 2에 사용할 password |
| --password3 | 다단계 인증 factor 3에 사용할 password |
| --pipe | Named pipe를 사용하여 server에 연결합니다(Windows 전용) |
| --port | 연결에 사용할 TCP/IP 포트 번호 |
| --print-defaults | 기본 옵션을 출력합니다 |
| --protocol | 사용할 전송 프로토콜 |
| --quick | 가장 빠른 검사 방법 |
| --repair | Unique key가 unique하지 않은 경우를 제외하고 거의 모든 문제를 고치는 복구 수행 |
| --server-public-key-path | RSA public key를 포함하는 file의 경로 이름 |
| --shared-memory-base-name | 공유 메모리 연결에 사용할 공유 메모리 이름(Windows 전용) |
| --silent | Silent mode |
| --skip-database | 수행 작업에서 이 database를 제외합니다 |
| --socket | 사용할 Unix 소켓 파일 또는 Windows named pipe |
| --ssl-ca | 신뢰할 수 있는 SSL Certificate Authority 목록을 포함하는 file |
| --ssl-capath | 신뢰할 수 있는 SSL Certificate Authority certificate file이 있는 디렉터리 |
| --ssl-cert | X.509 certificate를 포함하는 file |
| --ssl-cipher | 연결 암호화에 허용되는 cipher |
| --ssl-fips-mode | Client 측에서 FIPS mode를 활성화할지 여부 |
| --ssl-key | X.509 key를 포함하는 file |
| --ssl-mode | Server에 대한 연결의 원하는 보안 상태 |
| --ssl-session-data | SSL session data를 포함하는 file |
| --ssl-session-data-continue-on-failed-reuse | Session 재사용에 실패해도 연결을 설정할지 여부 |
| --tables | --databases 또는 -B 옵션을 override합니다 |
| --tls-ciphersuites | 암호화된 연결에 사용할 수 있는 TLSv1.3 ciphersuite |
| --tls-sni-servername | Client가 제공하는 server 이름 |
| --tls-version | 암호화된 연결에 허용되는 TLS 프로토콜 |
| --use-frm | MyISAM table에 대한 repair 작업 시 사용 |
| --user | Server에 연결할 때 사용할 MySQL user name |
| --verbose | Verbose mode |
| --version | 버전 정보를 표시하고 종료합니다 |
| --write-binlog | ANALYZE, OPTIMIZE, REPAIR statement를 binary log에 기록합니다. --skip-write-binlog는 NO_WRITE_TO_BINLOG를 이들 statement에 추가합니다 |
| --zstd-compression-level | zstd 압축을 사용하는 server 연결에 대한 압축 레벨 |
| Option Name | Description |
|---|
--help, -?| Property | Value |
|---|---|
| Command-Line Format | --help |
도움말 메시지를 표시하고 종료합니다.
--all-databases, -A| Property | Value |
|---|---|
| Command-Line Format | --all-databases |
모든 database의 모든 table을 검사합니다. 이는 command line에서
--databases 옵션을 사용하여 모든 database 이름을 나열하는 것과 동일하지만,
INFORMATION_SCHEMA 및
performance_schema database는 검사하지 않습니다. 이 database들을 검사하려면
--databases 옵션과 함께 명시적으로 이름을 지정해야 합니다.
--all-in-1, -1| Property | Value |
|---|---|
| Command-Line Format | --all-in-1 |
각 table마다 하나의 statement를 발행하는 대신, 각 database마다 해당 database에서 처리할 모든 table을 나열하는 단일 statement를 실행합니다.
--analyze, -a| Property | Value |
|---|---|
| Command-Line Format | --analyze |
Table을 분석합니다.
| Property | Value |
|---|---|
| Command-Line Format | --auto-repair |
검사된 table이 손상된 경우 자동으로 복구합니다. 필요한 모든 복구는 모든 table 검사가 완료된 후 수행됩니다.
| Property | Value |
|---|---|
| Command-Line Format | --bind-address=ip_address |
여러 개의 네트워크 인터페이스를 가진 컴퓨터에서, 이 옵션을 사용하여 MySQL server에 연결할 때 사용할 인터페이스를 선택합니다.
| Property | Value |
|---|---|
| Command-Line Format | --character-sets-dir=dir_name |
| Type | Directory name |
문자 집합이 설치된 디렉터리입니다. Section 12.15, “Character Set Configuration”을 참조하십시오.
--check, -c| Property | Value |
|---|---|
| Command-Line Format | --check |
Table에 error가 있는지 검사합니다. 이것이 기본 동작입니다.
| Property | Value |
|---|---|
| Command-Line Format | --check-only-changed |
마지막 검사 이후 변경되었거나 제대로 close되지 않은 table만 검사합니다.
--check-upgrade, -g| Property | Value |
|---|---|
| Command-Line Format | --check-upgrade |
현재 server version과의 호환성 문제를 검사하기 위해
CHECK TABLE을
FOR UPGRADE 옵션과 함께 호출합니다.
| Property | Value |
|---|---|
| Command-Line Format | `--compress[={OFF |
| Deprecated | Yes |
| Type | Boolean |
| Default Value | OFF |
가능한 경우 client와 server 간에 전송되는 모든 정보를 압축합니다. Section 6.2.8, “Connection Compression Control”을 참조하십시오.
이 옵션은 deprecated 상태입니다. 향후 MySQL version에서 제거될 예정입니다. Configuring Legacy Connection Compression을 참조하십시오.
| Property | Value |
|---|---|
| Command-Line Format | --compression-algorithms=value |
| Type | Set |
| Default Value | uncompressed |
| Valid Values | zlib<br>zstd<br>uncompressed |
Server 연결에 허용되는 압축 알고리즘입니다. 사용 가능한 알고리즘은
protocol_compression_algorithms
system variable과 동일합니다. 기본값은 uncompressed입니다.
자세한 내용은 Section 6.2.8, “Connection Compression Control”을 참조하십시오.
--databases, -B| Property | Value |
|---|---|
| Command-Line Format | --databases |
지정된 database의 모든 table을 처리합니다. 일반적으로 mysqlcheck는 command line의 첫 번째 이름 argument를 database 이름으로, 그 뒤의 이름들을 table 이름으로 취급합니다. 이 옵션을 사용하면 모든 이름 argument를 database 이름으로 취급합니다.
--debug[=debug_options], -# [debug_options]| Property | Value |
|---|---|
| Command-Line Format | --debug[=debug_options] |
| Type | String |
| Default Value | d:t:o |
디버그 로그를 기록합니다. 일반적인
debug_options 문자열은 d:t:o,file_name입니다. 기본값은 d:t:o입니다.
이 옵션은 MySQL이
WITH_DEBUG를 사용하여 build된 경우에만 사용할 수 있습니다. Oracle에서 제공하는 MySQL release binary는 이 옵션을 사용하여 build되지 않습니다.
| Property | Value |
|---|---|
| Command-Line Format | --debug-check |
| Type | Boolean |
| Default Value | FALSE |
Program 종료 시 일부 디버그 정보를 출력합니다.
이 옵션은 MySQL이
WITH_DEBUG를 사용하여 build된 경우에만 사용할 수 있습니다. Oracle에서 제공하는 MySQL release binary는 이 옵션을 사용하여 build되지 않습니다.
| Property | Value |
|---|---|
| Command-Line Format | --debug-info |
| Type | Boolean |
| Default Value | FALSE |
Program 종료 시 디버그 정보와 메모리 및 CPU 사용 통계를 출력합니다.
이 옵션은 MySQL이
WITH_DEBUG를 사용하여 build된 경우에만 사용할 수 있습니다. Oracle에서 제공하는 MySQL release binary는 이 옵션을 사용하여 build되지 않습니다.
| Property | Value |
|---|---|
| Command-Line Format | --default-character-set=charset_name |
| Type | String |
_charset_name_을 기본 문자 집합으로 사용합니다.
Section 12.15, “Character Set Configuration”을 참조하십시오.
| Property | Value |
|---|---|
| Command-Line Format | --defaults-extra-file=file_name |
| Type | File name |
Global option file 이후에(Unix에서는 user option file 이전에) 이 option file을 읽습니다. File이 존재하지 않거나 접근할 수 없는 경우 error가 발생합니다.
_file_name_이 절대 경로 이름이 아니면, 현재 디렉터리를 기준으로 해석됩니다.
이 옵션 및 기타 option-file 옵션에 대한 추가 정보는 Section 6.2.2.3, “Command-Line Options that Affect Option-File Handling”을 참조하십시오.
| Property | Value |
|---|---|
| Command-Line Format | --defaults-file=file_name |
| Type | File name |
지정된 option file만 사용합니다. File이 존재하지 않거나 접근할 수 없는 경우 error가 발생합니다.
_file_name_이 절대 경로 이름이 아니면, 현재 디렉터리를 기준으로 해석됩니다.
예외:
--defaults-file을 사용하더라도, client program은 .mylogin.cnf를 읽습니다.
이 옵션 및 기타 option-file 옵션에 대한 추가 정보는 Section 6.2.2.3, “Command-Line Options that Affect Option-File Handling”을 참조하십시오.
| Property | Value |
|---|---|
| Command-Line Format | --defaults-group-suffix=str |
| Type | String |
일반적인 option group뿐 아니라, 일반적인 이름에
str suffix가 붙은 group도 읽습니다. 예를 들어,
mysqlcheck는 일반적으로 [client] 및
[mysqlcheck] group을 읽습니다. 이 옵션이
--defaults-group-suffix=_other로 지정되면,
mysqlcheck는
[client_other] 및 [mysqlcheck_other] group도 읽습니다.
이 옵션 및 기타 option-file 옵션에 대한 추가 정보는 Section 6.2.2.3, “Command-Line Options that Affect Option-File Handling”을 참조하십시오.
--extended, -e| Property | Value |
|---|---|
| Command-Line Format | --extended |
이 옵션을 사용하여 table을 검사하는 경우, table이 100% 일관성(consistency)을 갖도록 보장하지만, 시간이 오래 걸립니다.
이 옵션을 사용하여 table을 복구하는 경우, extended repair를 실행합니다. 이는 실행 시간이 오래 걸릴 뿐만 아니라, 많은 garbage row를 생성할 수도 있습니다!
| Property | Value |
|---|---|
| Command-Line Format | --default-auth=plugin |
| Type | String |
사용할 client-side authentication plugin에 대한 힌트입니다. Section 8.2.17, “Pluggable Authentication”을 참조하십시오.
| Property | Value |
|---|---|
| Command-Line Format | --enable-cleartext-plugin |
| Type | Boolean |
| Default Value | FALSE |
mysql_clear_password cleartext authentication plugin을 활성화합니다.
( Section 8.4.1.3, “Client-Side Cleartext Pluggable Authentication”을 참조하십시오.)
--fast, -F| Property | Value |
|---|---|
| Command-Line Format | --fast |
제대로 close되지 않은 table만 검사합니다.
--force, -f| Property | Value |
|---|---|
| Command-Line Format | --force |
SQL error가 발생해도 계속 수행합니다.
| Property | Value |
|---|---|
| Command-Line Format | --get-server-public-key |
| Type | Boolean |
RSA key pair 기반 password 교환에 필요한 public key를 server에 요청합니다. 이 옵션은
caching_sha2_password authentication plugin으로 인증하는 client에 적용됩니다. 이 plugin의 경우, server는 요청이 있을 때만 public key를 보냅니다. 이 옵션은 해당 plugin으로 인증하지 않는 account에는 무시됩니다. 또한, client가 secure connection을 사용하여 server에 연결하는 경우처럼 RSA 기반 password 교환을 사용하지 않을 때에도 무시됩니다.
--server-public-key-path=file_name이 지정되고 유효한 public key file을 지정하는 경우, 이 옵션이
--get-server-public-key보다 우선합니다.
caching_sha2_password plugin에 대한 정보는
Section 8.4.1.1, “Caching SHA-2 Pluggable Authentication”을 참조하십시오.
--host=host_name, -h host_name| Property | Value |
|---|---|
| Command-Line Format | --host=host_name |
| Type | String |
| Default Value | localhost |
지정된 호스트의 MySQL server에 연결합니다.
| Property | Value |
|---|---|
| Command-Line Format | --login-path=name |
| Type | String |
.mylogin.cnf login path file의 지정된 login path에서 옵션을 읽습니다. “login path”는 어떤 MySQL server에 어떤 account로 연결할지를 지정하는 옵션을 포함하는 option group입니다. Login path file을 생성하거나 수정하려면
mysql_config_editor 유틸리티를 사용하십시오.
Section 6.6.7, “mysql_config_editor — MySQL Configuration Utility”를 참조하십시오.
이 옵션 및 기타 option-file 옵션에 대한 추가 정보는 Section 6.2.2.3, “Command-Line Options that Affect Option-File Handling”을 참조하십시오.
| Property | Value |
|---|---|
| Command-Line Format | --no-login-paths |
Login path file에서 옵션을 읽지 않습니다.
관련 정보는
--login-path를 참조하십시오.
이 옵션 및 기타 option-file 옵션에 대한 추가 정보는 Section 6.2.2.3, “Command-Line Options that Affect Option-File Handling”을 참조하십시오.
--medium-check, -m| Property | Value |
|---|---|
| Command-Line Format | --medium-check |
--extended 작업보다 빠른 검사를 수행합니다. 이는 대부분의 경우 충분한 99.99%의 error만을 찾습니다.
| Property | Value |
|---|---|
| Command-Line Format | --no-defaults |
어떤 option file도 읽지 않습니다. Option file을 읽는 과정에서 알 수 없는 옵션으로 인해 program 시작에 실패한다면,
--no-defaults를 사용하여 해당 file이 읽히지 않도록 할 수 있습니다.
예외: .mylogin.cnf file이 존재하면, 이 file은 항상 읽힙니다. 이를 통해,
--no-defaults를 사용할 때에도 command line에 password를 지정하는 것보다 안전한 방식으로 password를 지정할 수 있습니다. .mylogin.cnf를 생성하려면
mysql_config_editor 유틸리티를 사용하십시오.
Section 6.6.7, “mysql_config_editor — MySQL Configuration Utility”를 참조하십시오.
이 옵션 및 기타 option-file 옵션에 대한 추가 정보는 Section 6.2.2.3, “Command-Line Options that Affect Option-File Handling”을 참조하십시오.
--optimize, -o| Property | Value |
|---|---|
| Command-Line Format | --optimize |
Table을 최적화합니다.
--password[=password], -p[password]| Property | Value |
|---|---|
| Command-Line Format | --password[=password] |
| Type | String |
Server에 연결하는 데 사용되는 MySQL account의 password입니다. Password 값은 선택 사항입니다. 지정하지 않으면
mysqlcheck에서 프롬프트를 표시합니다. 지정하는 경우,
--password= 또는
-p와 그 뒤에 오는 password 사이에 공백이 없어야 합니다. 어떤 password 옵션도 지정하지 않으면, 기본적으로 password를 보내지 않습니다.
Command line에 password를 지정하는 것은 보안상 안전하지 않은 방법으로 간주해야 합니다. Command line에 password를 제공하지 않으려면 option file을 사용하십시오. Section 8.1.2.1, “End-User Guidelines for Password Security”를 참조하십시오.
Password가 없으며
mysqlcheck가 password를 요청하지 않도록 명시적으로 지정하려면
--skip-password 옵션을 사용하십시오.
Server에 연결하는 데 사용되는 MySQL account의 다단계 인증 factor 1에 대한 password입니다. Password 값은 선택 사항입니다. 지정하지 않으면
mysqlcheck에서 프롬프트를 표시합니다. 지정하는 경우,
--password1=과 그 뒤에 오는 password 사이에 공백이 없어야 합니다. 어떤 password 옵션도 지정하지 않으면, 기본적으로 password를 보내지 않습니다.
Command line에 password를 지정하는 것은 보안상 안전하지 않은 방법으로 간주해야 합니다. Command line에 password를 제공하지 않으려면 option file을 사용하십시오. Section 8.1.2.1, “End-User Guidelines for Password Security”를 참조하십시오.
Password가 없으며
mysqlcheck가 password를 요청하지 않도록 명시적으로 지정하려면
--skip-password1 옵션을 사용하십시오.
--password1과
--password는 동의어이며,
--skip-password1과
--skip-password도 동의어입니다.
Server에 연결하는 데 사용되는 MySQL account의 다단계 인증 factor 2에 대한 password입니다. 이 옵션의 의미는
--password1의 의미와 유사합니다. 자세한 내용은 해당 옵션 설명을 참조하십시오.
Server에 연결하는 데 사용되는 MySQL account의 다단계 인증 factor 3에 대한 password입니다. 이 옵션의 의미는
--password1의 의미와 유사합니다. 자세한 내용은 해당 옵션 설명을 참조하십시오.
--pipe, -W| Property | Value |
|---|---|
| Command-Line Format | --pipe |
| Type | String |
Windows에서 named pipe를 사용하여 server에 연결합니다. 이 옵션은 server가
named_pipe system variable을 활성화하여 named-pipe 연결을 지원하도록 시작된 경우에만 적용됩니다. 또한, 연결을 수행하는 사용자는
named_pipe_full_access_group
system variable에 지정된 Windows group의 구성원이어야 합니다.
| Property | Value |
|---|---|
| Command-Line Format | --plugin-dir=dir_name |
| Type | Directory name |
Plugin을 검색할 디렉터리입니다.
--default-auth 옵션을 사용하여 authentication plugin을 지정했으나,
mysqlcheck가 이를 찾지 못하는 경우 이 옵션을 지정하십시오.
Section 8.2.17, “Pluggable Authentication”을 참조하십시오.
--port=port_num, -P port_num| Property | Value |
|---|---|
| Command-Line Format | --port=port_num |
| Type | Numeric |
| Default Value | 3306 |
TCP/IP 연결에 사용할 포트 번호입니다.
| Property | Value |
|---|---|
| Command-Line Format | --print-defaults |
Program 이름과 option file에서 가져오는 모든 옵션을 출력합니다.
이 옵션 및 기타 option-file 옵션에 대한 추가 정보는 Section 6.2.2.3, “Command-Line Options that Affect Option-File Handling”을 참조하십시오.
| Property | Value |
|---|---|
| Command-Line Format | --protocol=type |
| Type | String |
| Default Value | [see text] |
| Valid Values | TCP<br>SOCKET<br>PIPE<br>MEMORY |
Server에 연결하는 데 사용할 전송 프로토콜입니다. 이는 다른 연결 파라미터가 일반적으로 원하는 것과 다른 프로토콜 사용으로 이어지는 경우에 유용합니다. 허용되는 값에 대한 자세한 내용은 Section 6.2.7, “Connection Transport Protocols”을 참조하십시오.
--quick, -q| Property | Value |
|---|---|
| Command-Line Format | --quick |
이 옵션을 사용하여 table을 검사하는 경우, 잘못된 link를 검사하기 위해 row를 scan하는 것을 방지합니다. 이는 가장 빠른 검사 방법입니다.
이 옵션을 사용하여 table을 복구하는 경우, index tree만 복구하려고 시도합니다. 이는 가장 빠른 복구 방법입니다.
--repair, -r| Property | Value |
|---|---|
| Command-Line Format | --repair |
Unique하지 않은 unique key를 제외하고 거의 모든 문제를 고치는 복구를 수행합니다.
| Property | Value |
|---|---|
| Command-Line Format | --server-public-key-path=file_name |
| Type | File name |
Server가 RSA key pair 기반 password 교환을 위해 요구하는 public key의 client-side 사본을 포함한 PEM format file의 경로 이름입니다. 이 옵션은
sha256_password 또는
caching_sha2_password authentication plugin으로 인증하는 client에 적용됩니다. 이 plugin들로 인증하지 않는 account에는 이 옵션이 무시됩니다. 또한, client가 secure connection을 사용하여 server에 연결하는 경우처럼 RSA 기반 password 교환을 사용하지 않을 때에도 무시됩니다.
--server-public-key-path=file_name이 지정되고 유효한 public key file을 지정하는 경우, 이 옵션이
--get-server-public-key보다 우선합니다.
sha256_password의 경우, MySQL이 OpenSSL을 사용하여 build된 경우에만 이 옵션이 적용됩니다.
sha256_password 및
caching_sha2_password plugin에 대한 정보는
Section 8.4.1.2, “SHA-256 Pluggable Authentication” 및
Section 8.4.1.1, “Caching SHA-2 Pluggable Authentication”을 참조하십시오.
| Property | Value |
|---|---|
| Command-Line Format | --shared-memory-base-name=name |
| Platform Specific | Windows |
Windows에서 local server에 대한 공유 메모리 연결을 만들 때 사용할 공유 메모리 이름입니다. 기본값은 MYSQL입니다. 공유 메모리 이름은 대소문자를 구분합니다.
이 옵션은 server가
shared_memory system variable을 활성화하여 공유 메모리 연결을 지원하도록 시작된 경우에만 적용됩니다.
--silent, -s| Property | Value |
|---|---|
| Command-Line Format | --silent |
Silent mode입니다. Error message만 출력합니다.
| Property | Value |
|---|---|
| Command-Line Format | --skip-database=db_name |
mysqlcheck가 수행하는 작업에서 지정된 database(대소문자 구분)를 포함하지 않습니다.
--socket=path, -S path| Property | Value |
|---|---|
| Command-Line Format | `--socket={file_name |
| Type | String |
localhost에 대한 연결에서 사용할 Unix 소켓 파일 또는(Windows에서는) named pipe 이름입니다.
Windows에서 이 옵션은 server가
named_pipe
system variable을 활성화하여 named-pipe 연결을 지원하도록 시작된 경우에만 적용됩니다. 또한, 연결을 수행하는 사용자는
named_pipe_full_access_group
system variable에 지정된 Windows group의 구성원이어야 합니다.
--ssl*--ssl로 시작하는 옵션은 Server에 대한 연결을 암호화하여 수행할지 여부와, SSL key 및 certificate의 위치를 지정합니다.
Command Options for Encrypted Connections를 참조하십시오.
| Property | Value |
|---|---|
| Command-Line Format | `--ssl-fips-mode={OFF |
| Deprecated | Yes |
| Type | Enumeration |
| Default Value | OFF |
| Valid Values | OFF<br>ON<br>STRICT |
Client 측에서 FIPS mode를 활성화할지 여부를 제어합니다.
--ssl-fips-mode 옵션은 암호화된 연결을 설정하는 데 사용되는 다른 --ssl-xxx 옵션과 달리, 허용할 암호화 연산을 제어하는 데 사용됩니다.
Section 8.8, “FIPS Support”를 참조하십시오.
허용되는
--ssl-fips-mode 값은 다음과 같습니다:
OFF: FIPS mode를 비활성화합니다.
ON: FIPS mode를 활성화합니다.
STRICT: “strict” FIPS mode를 활성화합니다.
참고
OpenSSL FIPS Object Module을 사용할 수 없는 경우,
--ssl-fips-mode의 유일하게 허용되는 값은 OFF입니다. 이 경우,
--ssl-fips-mode를
ON 또는 STRICT로 설정하면, Client는 startup 시 warning을 출력하고 non-FIPS mode에서 동작합니다.
이 옵션은 deprecated 상태입니다. 향후 MySQL version에서 제거될 예정입니다.
| Property | Value |
|---|---|
| Command-Line Format | --tables |
--databases 또는 -B 옵션을 override합니다. 이 옵션 뒤에 오는 모든 이름 argument는 table 이름으로 간주됩니다.
| Property | Value |
|---|---|
| Command-Line Format | --tls-ciphersuites=ciphersuite_list |
| Type | String |
TLSv1.3을 사용하는 암호화된 연결에 허용되는 ciphersuite입니다. 값은 하나 이상의 ciphersuite 이름을 콜론으로 구분한 목록입니다. 이 옵션에 대해 지정할 수 있는 ciphersuite는 MySQL을 build할 때 사용한 SSL library에 따라 달라집니다. 자세한 내용은 Section 8.3.2, “Encrypted Connection TLS Protocols and Ciphers”을 참조하십시오.
| Property | Value |
|---|---|
| Command-Line Format | --tls-sni-servername=server_name |
| Type | String |
지정된 경우, 이 이름은 libmysqlclient C API library에
mysql_options()의
MYSQL_OPT_TLS_SNI_SERVERNAME 옵션을 사용하여 전달됩니다. Server 이름은 대소문자를 구분하지 않습니다. 현재 session에 대해 client가 지정한 server 이름(있는 경우)을 확인하려면,
Tls_sni_server_name status variable을 확인하십시오.
Server Name Indication(SNI)는 TLS 프로토콜에 대한 extension입니다 (이 옵션이 동작하려면 OpenSSL이 TLS extension을 사용하여 build되어야 합니다). MySQL의 SNI 구현은 client-side만을 의미합니다.
| Property | Value |
|---|---|
| Command-Line Format | --tls-version=protocol_list |
| Type | String |
| Default Value | TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 (OpenSSL 1.1.1 이상)<br>TLSv1,TLSv1.1,TLSv1.2 (그 외) |
암호화된 연결에 허용되는 TLS 프로토콜입니다. 값은 하나 이상의 protocol 이름을 콤마로 구분한 목록입니다. 이 옵션에 대해 지정할 수 있는 protocol은 MySQL을 build할 때 사용한 SSL library에 따라 달라집니다. 자세한 내용은 Section 8.3.2, “Encrypted Connection TLS Protocols and Ciphers”을 참조하십시오.
| Property | Value |
|---|---|
| Command-Line Format | --use-frm |
MyISAM table에 대한 REPAIR 작업 시, .MYI header가 손상된 경우에도 table을 복구할 수 있도록 data dictionary에서 table 구조를 가져옵니다.
--user=user_name, -u user_name| Property | Value |
|---|---|
| Command-Line Format | --user=user_name, |
| Type | String |
Server에 연결할 때 사용할 MySQL account의 user name입니다.
--verbose, -v| Property | Value |
|---|---|
| Command-Line Format | --verbose |
Verbose mode입니다. Program 동작의 다양한 단계에 대한 정보를 출력합니다.
--version, -V| Property | Value |
|---|---|
| Command-Line Format | --version |
버전 정보를 표시하고 종료합니다.
| Property | Value |
|---|---|
| Command-Line Format | --write-binlog |
이 옵션은 기본적으로 활성화되어 있으므로,
mysqlcheck가 생성한
ANALYZE TABLE,
OPTIMIZE TABLE,
REPAIR TABLE statement가 binary log에 기록됩니다. 이 statement들이 log에 기록되지 않도록 하려면
--skip-write-binlog을 사용하여 statement에 NO_WRITE_TO_BINLOG가 추가되도록 하십시오. 이 statement를 replica로 전송하거나 backup에서 복구를 위해 binary log를 사용할 때 실행하지 않으려는 경우
--skip-write-binlog을 사용하십시오.
| Property | Value |
|---|---|
| Command-Line Format | --zstd-compression-level=# |
| Type | Integer |
zstd 압축 알고리즘을 사용하는 server 연결에 사용할 압축 레벨입니다. 허용되는 레벨은 1에서 22까지이며, 값이 클수록 더 높은 압축 레벨을 의미합니다. 기본 zstd 압축 레벨은 3입니다. 이 설정은 zstd 압축을 사용하지 않는 연결에는 영향을 미치지 않습니다.
자세한 내용은 Section 6.2.8, “Connection Compression Control”을 참조하십시오.
6.5.2 mysqladmin — A MySQL Server Administration Program
6.5.4 mysqldump — A Database Backup Program