Skip to content

Commit

Permalink
Correct MySQL Shell/Client section (#8779) (#10947)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Oct 21, 2022
1 parent 925cb1e commit ad3e178
Showing 1 changed file with 21 additions and 5 deletions.
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 protocol. For a full list of client lin

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

0 comments on commit ad3e178

Please sign in to comment.