From f5ac86a52331351003bc8a07794f3f6525f5001f Mon Sep 17 00:00:00 2001 From: shichun-0415 Date: Mon, 30 Jan 2023 17:09:27 +0800 Subject: [PATCH 1/4] Add description about --initialize-sql-file option --- command-line-flags-for-tidb-configuration.md | 5 +++++ tidb-configuration-file.md | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/command-line-flags-for-tidb-configuration.md b/command-line-flags-for-tidb-configuration.md index 4a41345fe2cb9..ac97512582491 100644 --- a/command-line-flags-for-tidb-configuration.md +++ b/command-line-flags-for-tidb-configuration.md @@ -56,6 +56,11 @@ When you start the TiDB cluster, you can use command-line options or environment - Bootstraps tidb-server in secure mode - Default: `false` +## `--initialize-sql-file` + +- The SQL script to be executed when the TiDB cluster is started for the first time. For details, see [configuration item `initialize-sql-file`](/tidb-configuration-file.md#initialize-sql-file-new-in-v660) +- Default: "" + ## `-L` - The log level diff --git a/tidb-configuration-file.md b/tidb-configuration-file.md index b6e1a24dc706f..364b78b3769c3 100644 --- a/tidb-configuration-file.md +++ b/tidb-configuration-file.md @@ -184,6 +184,13 @@ The TiDB configuration file supports more options than command-line parameters. + Default value: `true` + When the value is `true`, both `KILL` and `KILL TIDB` statements can terminate queries or connections across instances so you do not need to worry about erroneously terminating queries or connections. When you use a client to connect to any TiDB instance and execute the `KILL` or `KILL TIDB` statement, the statement will be forwarded to the target TiDB instance. If there is a proxy between the client and the TiDB cluster, the `KILL` and `KILL TIDB` statements will also be forwarded to the target TiDB instance for execution. Currently, using the MySQL command line ctrl+c to terminate a query or connection in TiDB is not supported when `enable-global-kill` is `true`. For more information on the `KILL` statement, see [KILL](/sql-statements/sql-statement-kill.md). +### `initialize-sql-file` New in v6.6.0 + ++ Specifies the SQL script to be executed when the TiDB cluster is started for the first time. ++ Default value: "" ++ All SQL statements in this script are executed with the highest privilege without any privilege check. If the specified SQL script fails to execute, the TiDB cluster might fail to start. ++ This configuration item is used to perform such operations as modifying the value of a system variable, creating a user, or granting permissions. + ### `enable-forwarding` New in v5.0.0 + Controls whether the PD client and TiKV client in TiDB forward requests to the leader via the followers in the case of possible network isolation. From 8773b9d5915d103f2acd608d69c919eb173c416e Mon Sep 17 00:00:00 2001 From: shichun-0415 <89768198+shichun-0415@users.noreply.github.com> Date: Mon, 30 Jan 2023 17:45:23 +0800 Subject: [PATCH 2/4] Apply suggestions from code review Co-authored-by: CbcWestwolf <1004626265@qq.com> --- tidb-configuration-file.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tidb-configuration-file.md b/tidb-configuration-file.md index 364b78b3769c3..4ad79aabf50f1 100644 --- a/tidb-configuration-file.md +++ b/tidb-configuration-file.md @@ -189,7 +189,7 @@ The TiDB configuration file supports more options than command-line parameters. + Specifies the SQL script to be executed when the TiDB cluster is started for the first time. + Default value: "" + All SQL statements in this script are executed with the highest privilege without any privilege check. If the specified SQL script fails to execute, the TiDB cluster might fail to start. -+ This configuration item is used to perform such operations as modifying the value of a system variable, creating a user, or granting permissions. ++ This configuration item is used to perform such operations as modifying the value of a system variable, creating a user, or granting privileges. ### `enable-forwarding` New in v5.0.0 From 02cb9d480544f5ffc8306db059412632de37eb68 Mon Sep 17 00:00:00 2001 From: shichun-0415 <89768198+shichun-0415@users.noreply.github.com> Date: Wed, 8 Feb 2023 13:39:11 +0800 Subject: [PATCH 3/4] Apply suggestions from code review Co-authored-by: Aolin --- command-line-flags-for-tidb-configuration.md | 2 +- tidb-configuration-file.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/command-line-flags-for-tidb-configuration.md b/command-line-flags-for-tidb-configuration.md index ac97512582491..079cfa427223c 100644 --- a/command-line-flags-for-tidb-configuration.md +++ b/command-line-flags-for-tidb-configuration.md @@ -59,7 +59,7 @@ When you start the TiDB cluster, you can use command-line options or environment ## `--initialize-sql-file` - The SQL script to be executed when the TiDB cluster is started for the first time. For details, see [configuration item `initialize-sql-file`](/tidb-configuration-file.md#initialize-sql-file-new-in-v660) -- Default: "" +- Default: `""` ## `-L` diff --git a/tidb-configuration-file.md b/tidb-configuration-file.md index 4ad79aabf50f1..7bfeae6e77d88 100644 --- a/tidb-configuration-file.md +++ b/tidb-configuration-file.md @@ -187,7 +187,7 @@ The TiDB configuration file supports more options than command-line parameters. ### `initialize-sql-file` New in v6.6.0 + Specifies the SQL script to be executed when the TiDB cluster is started for the first time. -+ Default value: "" ++ Default value: `""` + All SQL statements in this script are executed with the highest privilege without any privilege check. If the specified SQL script fails to execute, the TiDB cluster might fail to start. + This configuration item is used to perform such operations as modifying the value of a system variable, creating a user, or granting privileges. From 1d62f55adb8df704db199393251a80250b3efb06 Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Thu, 9 Mar 2023 15:31:18 +0800 Subject: [PATCH 4/4] Apply suggestions from code review --- command-line-flags-for-tidb-configuration.md | 2 +- tidb-configuration-file.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/command-line-flags-for-tidb-configuration.md b/command-line-flags-for-tidb-configuration.md index 079cfa427223c..81a2954ba387f 100644 --- a/command-line-flags-for-tidb-configuration.md +++ b/command-line-flags-for-tidb-configuration.md @@ -58,7 +58,7 @@ When you start the TiDB cluster, you can use command-line options or environment ## `--initialize-sql-file` -- The SQL script to be executed when the TiDB cluster is started for the first time. For details, see [configuration item `initialize-sql-file`](/tidb-configuration-file.md#initialize-sql-file-new-in-v660) +- The SQL script to be executed when the TiDB cluster is started for the first time. For details, see [configuration item `initialize-sql-file`](/tidb-configuration-file.md#initialize-sql-file-new-in-v651) - Default: `""` ## `-L` diff --git a/tidb-configuration-file.md b/tidb-configuration-file.md index 7bfeae6e77d88..b85c489c591e2 100644 --- a/tidb-configuration-file.md +++ b/tidb-configuration-file.md @@ -184,7 +184,7 @@ The TiDB configuration file supports more options than command-line parameters. + Default value: `true` + When the value is `true`, both `KILL` and `KILL TIDB` statements can terminate queries or connections across instances so you do not need to worry about erroneously terminating queries or connections. When you use a client to connect to any TiDB instance and execute the `KILL` or `KILL TIDB` statement, the statement will be forwarded to the target TiDB instance. If there is a proxy between the client and the TiDB cluster, the `KILL` and `KILL TIDB` statements will also be forwarded to the target TiDB instance for execution. Currently, using the MySQL command line ctrl+c to terminate a query or connection in TiDB is not supported when `enable-global-kill` is `true`. For more information on the `KILL` statement, see [KILL](/sql-statements/sql-statement-kill.md). -### `initialize-sql-file` New in v6.6.0 +### `initialize-sql-file` New in v6.5.1 + Specifies the SQL script to be executed when the TiDB cluster is started for the first time. + Default value: `""`