Skip to content

Commit

Permalink
dev guide: use SimpleTab to describe two MySQL clients
Browse files Browse the repository at this point in the history
Signed-off-by: Aolin <aolin.zhang@pingcap.com>
  • Loading branch information
Oreoxmt committed Feb 13, 2023
1 parent 9ffd24a commit 56db642
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions develop/dev-guide-connect-to-tidb.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ 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

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

## MySQL Client
<SimpleTab>

<div label="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.

Expand All @@ -25,14 +29,20 @@ After the installation, you can connect to TiDB using the following command:
mysql --host <tidb_server_host> --port 4000 -u root -p --comments
```

## MySQL Shell
</div>

<div label="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:

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

</div>

</SimpleTab>

## JDBC

You can connect to TiDB using the [JDBC](https://dev.mysql.com/doc/connector-j/8.0/en/) driver. To do that, you need to create a `MysqlDataSource` or `MysqlConnectionPoolDataSource` object (both objects support the `DataSource` interface), and then set the connection string using the `setURL` function.
Expand Down

0 comments on commit 56db642

Please sign in to comment.