Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct MySQL Shell/Client section #8779

Merged
merged 1 commit into from
Oct 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions develop/dev-guide-connect-to-tidb.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,35 @@ TiDB is highly compatible with the MySQL 5.7 protocol. For a full list of client

TiDB supports the [MySQL Client/Server Protocol](https://dev.mysql.com/doc/internals/en/client-server-protocol.html), which allows most client drivers and ORM frameworks to connect to TiDB just as they connect to MySQL.

## MySQL Shell
You can choose to use MySQL Client or MySQL Shell based on your personal preferences.

You can connect to TiDB using MySQL Shell, which can be used as a command-line tool for TiDB. To install MySQL Shell, follow the instructions in the [MySQL Shell documentation](https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-install.html). After the installation, you can connect to TiDB using the following command:
## MySQL Client

You can connect to TiDB using MySQL Client, which can be used as a command-line tool for TiDB. To install MySQL Client, follow the instructions below for YUM based Linux distributions.

{{< copyable "shell-regular" >}}

```shell
sudo yum install mysql
```

After the installation, you can connect to TiDB using the following command:

{{< copyable "shell-regular" >}}

```shell
mysql --host <tidb_server_host> --port 4000 -u root -p --comments
```

> **Note:**
>
> The MySQL Shell earlier than version 5.7.7 clears [Optimizer Hints](/optimizer-hints.md#optimizer-hints) by default. If you need to use the Hint syntax in an earlier MySQL Shell version, add the `--comments` option when starting the client.
## MySQL Shell

You can connect to TiDB using MySQL Shell, which can be used as a command-line tool for TiDB. To install MySQL Shell, follow the instructions in the [MySQL Shell documentation](https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-install.html). After the installation, you can connect to TiDB using the following command:

{{< copyable "shell-regular" >}}

```shell
mysqlsh --sql mysql://root@<tidb_server_host>:4000
```

## JDBC

Expand Down