diff --git a/docs/nightly/en/greptimecloud/integrations/mysql.md b/docs/nightly/en/greptimecloud/integrations/mysql.md index 5308cd3b2..3f9b0654f 100644 --- a/docs/nightly/en/greptimecloud/integrations/mysql.md +++ b/docs/nightly/en/greptimecloud/integrations/mysql.md @@ -36,6 +36,8 @@ Use following connect string for your JDBC client. jdbc:mysql://:4002/?user=&password= ``` +Read the [time zone setting](https://docs.greptime.com/user-guide/client-libraries/java#time-zone) for JDBC. + And if you are using client like Python, use following url to connect to your instance. diff --git a/docs/nightly/en/user-guide/client-libraries/java.md b/docs/nightly/en/user-guide/client-libraries/java.md index 644a1a63e..bec0fbd40 100644 --- a/docs/nightly/en/user-guide/client-libraries/java.md +++ b/docs/nightly/en/user-guide/client-libraries/java.md @@ -444,6 +444,17 @@ db.password= Or you can just get the file from [here](https://github.com/GreptimeTeam/greptimedb-ingester-java/blob/main/ingester-example/src/main/resources/db-connection.properties). +#### Time zone + +Set the JDBC time zone by setting URL parameters: + +```txt +jdbc:mysql://127.0.0.1:4002?connectionTimeZone=Asia/Shanghai&forceConnectionTimeZoneToSession=true +``` + +* `connectionTimeZone={LOCAL|SERVER|user-defined-time-zone}` specifies the connection time zone. +* `forceConnectionTimeZoneToSession=true` makes the session `time_zone` variable to be set to the value specified in `connectionTimeZone`. + %} {template query-library-raw-sql% diff --git a/docs/nightly/zh/greptimecloud/integrations/mysql.md b/docs/nightly/zh/greptimecloud/integrations/mysql.md index 799d36e5d..211940df0 100644 --- a/docs/nightly/zh/greptimecloud/integrations/mysql.md +++ b/docs/nightly/zh/greptimecloud/integrations/mysql.md @@ -34,6 +34,8 @@ mysql --ssl -u -p -h -P 4002 -A jdbc:mysql://:4002/?user=&password= ``` + JDBC 的时区设置请阅读[这篇文档](https://docs.greptime.cn/user-guide/client-libraries/java#时区)。 + 如果你使用 Python 等语言的客户端,也可以复制以下 URL 进行连接 ``` diff --git a/docs/nightly/zh/user-guide/client-libraries/java.md b/docs/nightly/zh/user-guide/client-libraries/java.md index a52837b4b..7c0f04c81 100644 --- a/docs/nightly/zh/user-guide/client-libraries/java.md +++ b/docs/nightly/zh/user-guide/client-libraries/java.md @@ -437,6 +437,16 @@ db.password= 或者你可以从[这里](https://github.com/GreptimeTeam/greptimedb-ingester-java/blob/main/ingester-example/src/main/resources/db-connection.properties)获取文件。 +#### 时区 + +通过设置 URL 参数来设置 JDBC 时区: + +```txt +jdbc:mysql://127.0.0.1:4002?connectionTimeZone=Asia/Shanghai&forceConnectionTimeZoneToSession=true +``` + +* `connectionTimeZone={LOCAL|SERVER|user-defined-time-zone}` 配置连接时区。 +* `forceConnectionTimeZoneToSession=true` 使 session `time_zone` 变量被设置为 `connectionTimeZone` 指定的值。 %} {template query-library-raw-sql% diff --git a/docs/v0.8/en/greptimecloud/integrations/mysql.md b/docs/v0.8/en/greptimecloud/integrations/mysql.md index 5308cd3b2..3f9b0654f 100644 --- a/docs/v0.8/en/greptimecloud/integrations/mysql.md +++ b/docs/v0.8/en/greptimecloud/integrations/mysql.md @@ -36,6 +36,8 @@ Use following connect string for your JDBC client. jdbc:mysql://:4002/?user=&password= ``` +Read the [time zone setting](https://docs.greptime.com/user-guide/client-libraries/java#time-zone) for JDBC. + And if you are using client like Python, use following url to connect to your instance. diff --git a/docs/v0.8/en/user-guide/client-libraries/java.md b/docs/v0.8/en/user-guide/client-libraries/java.md index 644a1a63e..bec0fbd40 100644 --- a/docs/v0.8/en/user-guide/client-libraries/java.md +++ b/docs/v0.8/en/user-guide/client-libraries/java.md @@ -444,6 +444,17 @@ db.password= Or you can just get the file from [here](https://github.com/GreptimeTeam/greptimedb-ingester-java/blob/main/ingester-example/src/main/resources/db-connection.properties). +#### Time zone + +Set the JDBC time zone by setting URL parameters: + +```txt +jdbc:mysql://127.0.0.1:4002?connectionTimeZone=Asia/Shanghai&forceConnectionTimeZoneToSession=true +``` + +* `connectionTimeZone={LOCAL|SERVER|user-defined-time-zone}` specifies the connection time zone. +* `forceConnectionTimeZoneToSession=true` makes the session `time_zone` variable to be set to the value specified in `connectionTimeZone`. + %} {template query-library-raw-sql% diff --git a/docs/v0.8/zh/greptimecloud/integrations/mysql.md b/docs/v0.8/zh/greptimecloud/integrations/mysql.md index 799d36e5d..211940df0 100644 --- a/docs/v0.8/zh/greptimecloud/integrations/mysql.md +++ b/docs/v0.8/zh/greptimecloud/integrations/mysql.md @@ -34,6 +34,8 @@ mysql --ssl -u -p -h -P 4002 -A jdbc:mysql://:4002/?user=&password= ``` + JDBC 的时区设置请阅读[这篇文档](https://docs.greptime.cn/user-guide/client-libraries/java#时区)。 + 如果你使用 Python 等语言的客户端,也可以复制以下 URL 进行连接 ``` diff --git a/docs/v0.8/zh/user-guide/client-libraries/java.md b/docs/v0.8/zh/user-guide/client-libraries/java.md index a52837b4b..7c0f04c81 100644 --- a/docs/v0.8/zh/user-guide/client-libraries/java.md +++ b/docs/v0.8/zh/user-guide/client-libraries/java.md @@ -437,6 +437,16 @@ db.password= 或者你可以从[这里](https://github.com/GreptimeTeam/greptimedb-ingester-java/blob/main/ingester-example/src/main/resources/db-connection.properties)获取文件。 +#### 时区 + +通过设置 URL 参数来设置 JDBC 时区: + +```txt +jdbc:mysql://127.0.0.1:4002?connectionTimeZone=Asia/Shanghai&forceConnectionTimeZoneToSession=true +``` + +* `connectionTimeZone={LOCAL|SERVER|user-defined-time-zone}` 配置连接时区。 +* `forceConnectionTimeZoneToSession=true` 使 session `time_zone` 变量被设置为 `connectionTimeZone` 指定的值。 %} {template query-library-raw-sql%