Skip to content

Latest commit

 

History

History
70 lines (50 loc) · 3.94 KB

ticloud-connect.md

File metadata and controls

70 lines (50 loc) · 3.94 KB
title summary
ticloud connect
The reference of `ticloud connect`.

ticloud connect

Connect to a TiDB Cloud cluster or branch:

ticloud connect [flags]

Note:

  • If you are prompted about whether to use the default user, you can choose Y to use the default root user or choose n to specify another user. For TiDB Serverless clusters, the name of the default root user has a prefix such as 3pTAoNNegb47Uc8.
  • The connection forces the ANSI SQL mode for the session. To exit the session, enter \q.

Examples

Connect to a TiDB Cloud cluster or branch in interactive mode:

ticloud connect

Use the default user to connect to a TiDB Cloud cluster or branch in non-interactive mode:

ticloud connect -p <project-id> -c <cluster-id>
ticloud connect -p <project-id> -c <cluster-id> -b <branch-id>

Use the default user to connect to the TiDB Cloud cluster or branch with password in non-interactive mode:

ticloud connect -p <project-id> -c <cluster-id> --password <password>
ticloud connect -p <project-id> -c <cluster-id> -b <branch-id> --password <password>

Use a specific user to connect to the TiDB Cloud cluster or branch in non-interactive mode:

ticloud connect -p <project-id> -c <cluster-id> -u <user-name>
ticloud connect -p <project-id> -c <cluster-id> -b <branch-id> -u <user-name>

Flags

In non-interactive mode, you need to manually enter the required flags. In interactive mode, you can just follow CLI prompts to fill them in.

Flag Description Required Note
-c, --cluster-id string Cluster ID Yes Only works in non-interactive mode.
-b, --branch-id string Branch ID No Only works in non-interactive mode.
-h, --help Help information for this command No Works in both non-interactive and interactive modes.
--password The password of the user No Only works in non-interactive mode.
-p, --project-id string Project ID Yes Only works in non-interactive mode.
-u, --user string A specific user for login No Only works in non-interactive mode.

Inherited flags

Flag Description Required Note
--no-color Disables color in output. No Only works in non-interactive mode. In interactive mode, disabling color might not work with some UI components.
-P, --profile string Specifies the active user profile used in this command. No Works in both non-interactive and interactive modes.

Feedback

If you have any questions or suggestions on the TiDB Cloud CLI, feel free to create an issue. Also, we welcome any contributions.