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

feat: Developer Guide - GUI - Navicat #15347

Merged
merged 13 commits into from
Nov 30, 2023
1 change: 1 addition & 0 deletions TOC-tidb-cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- [JetBrains DataGrip](/develop/dev-guide-gui-datagrip.md)
- [DBeaver](/develop/dev-guide-gui-dbeaver.md)
- [VS Code](/develop/dev-guide-gui-vscode-sqltools.md)
- [Navicat](/develop/dev-guide-gui-navicat.md)
- [Choose Driver or ORM](/develop/dev-guide-choose-driver-or-orm.md)
- Java
- [JDBC](/develop/dev-guide-sample-application-java-jdbc.md)
Expand Down
1 change: 1 addition & 0 deletions TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
- [JetBrains DataGrip](/develop/dev-guide-gui-datagrip.md)
- [DBeaver](/develop/dev-guide-gui-dbeaver.md)
- [VS Code](/develop/dev-guide-gui-vscode-sqltools.md)
- [Navicat](/develop/dev-guide-gui-navicat.md)
- [Choose Driver or ORM](/develop/dev-guide-choose-driver-or-orm.md)
- [Connect to TiDB](/develop/dev-guide-connect-to-tidb.md)
- [Connection Pools and Connection Parameters](/develop/dev-guide-connection-parameters.md)
Expand Down
152 changes: 152 additions & 0 deletions develop/dev-guide-gui-navicat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
---
title: Connect to TiDB with Navicat
summary: Learn how to connect to TiDB using Navicat.
---

# Connect to TiDB with Navicat

TiDB is a MySQL-compatible database, and [Navicat](https://www.navicat.com) is a GUI tool set for database users. This tutorial uses the [Navicat for MySQL](https://www.navicat.com/en/products/navicat-for-mysql) tool to connect to TiDB.

> **Warning:**
>
> Navicat is not full supported TiDB. Navicat can connect to TiDB, because of TiDB is a MySQL-compatible database. So the Navicat will treat TiDB as a MySQL. But there some errors might be occered when you are using it. Besides, the Navicat is not free. If it is possible, recommand you use some other free GUI tools, they supported TiDB officially:
Icemap marked this conversation as resolved.
Show resolved Hide resolved
Icemap marked this conversation as resolved.
Show resolved Hide resolved
>
> - [DataGrip](/develop/dev-guide-gui-datagrip.md)
Icemap marked this conversation as resolved.
Show resolved Hide resolved
> - [DBeaver](/develop/dev-guide-gui-dbeaver.md)
> - [VS Code SQLTools](/develop/dev-guide-gui-vscode-sqltools.md)

In this tutorial, you can learn how to connect to your TiDB cluster using Navicat.

> **Note:**
>
> This tutorial is compatible with TiDB Serverless, TiDB Dedicated, and TiDB Self-Hosted.

## Prerequisites

To complete this tutorial, you need:

- [Navicat for MySQL](https://www.navicat.com/en/download/navicat-for-mysql) **16.3.2** or later versions.
- A Navicat for MySQL paid account.
Oreoxmt marked this conversation as resolved.
Show resolved Hide resolved
- A TiDB cluster.

<CustomContent platform="tidb">

**If you don't have a TiDB cluster, you can create one as follows:**

- (Recommended) Follow [Creating a TiDB Serverless cluster](/develop/dev-guide-build-cluster-in-cloud.md) to create your own TiDB Cloud cluster.
- Follow [Deploy a local test TiDB cluster](/quick-start-with-tidb.md#deploy-a-local-test-cluster) or [Deploy a production TiDB cluster](/production-deployment-using-tiup.md) to create a local cluster.

</CustomContent>
<CustomContent platform="tidb-cloud">

**If you don't have a TiDB cluster, you can create one as follows:**

- (Recommended) Follow [Creating a TiDB Serverless cluster](/develop/dev-guide-build-cluster-in-cloud.md) to create your own TiDB Cloud cluster.
- Follow [Deploy a local test TiDB cluster](https://docs.pingcap.com/tidb/stable/quick-start-with-tidb#deploy-a-local-test-cluster) or [Deploy a production TiDB cluster](https://docs.pingcap.com/tidb/stable/production-deployment-using-tiup) to create a local cluster.

</CustomContent>

## Connect to TiDB

Connect to your TiDB cluster depending on the TiDB deployment option you have selected.

<SimpleTab>
<div label="TiDB Serverless">

1. Navigate to the [**Clusters**](https://tidbcloud.com/console/clusters) page, and then click the name of your target cluster to go to its overview page.

2. Click **Connect** in the upper-right corner. A connection dialog is displayed.

3. Ensure the configurations in the connection dialog match your operating environment.

- **Endpoint Type** is set to `Public`.
- **Connect With** is set to `General`.
- **Operating System** matches your environment.

4. Click **Create password** to create a random password.

> **Tip:**
>
> If you have created a password before, you can either use the original password or click **Reset password** to generate a new one.

5. Launch Navicat and click the **Connection** in the upper-left corner. In the selection panel, click **MySQL** as the database type.
Icemap marked this conversation as resolved.
Show resolved Hide resolved

![Navicat: add new connection](/media/develop/navicat-add-new-connection.jpg)

6. In the setting panel, configure the following connection parameters:
Icemap marked this conversation as resolved.
Show resolved Hide resolved

- **Connection Name**: give this connection a meaningful name.
- **Host**: enter the `host` parameter from the TiDB Cloud connection dialog.
Mini256 marked this conversation as resolved.
Show resolved Hide resolved
- **Port**: enter the `port` parameter from the TiDB Cloud connection dialog.
- **Username**: enter the `user` parameter from the TiDB Cloud connection dialog.
Icemap marked this conversation as resolved.
Show resolved Hide resolved
- **Password**: enter the password of the TiDB Serverless cluster.

![Navicat: configure connection general panel for TiDB Serverless](/media/develop/navicat-connection-config-serverless-general.png)

7. Click the **SSL** tab, check **Use SSL**, **Use authentication**, **Verify server certificate against CA**, and enter the `ssl_ca` parameter from the TiDB Cloud connection dialog into the **CA Certificate** input box. **Test Connection** to validate the connection to the TiDB Serverless cluster.
Icemap marked this conversation as resolved.
Show resolved Hide resolved

![Navicat: configure connection SSL panel for TiDB Serverless](/media/develop/navicat-connection-config-serverless-ssl.png)

8. If the connection test is successful, you can see the **Connection Successful** message. Click **Save** to save the connection configuration.
Icemap marked this conversation as resolved.
Show resolved Hide resolved

</div>
<div label="TiDB Dedicated">

1. Navigate to the [**Clusters**](https://tidbcloud.com/console/clusters) page, and then click the name of your target cluster to go to its overview page.

2. Click **Connect** in the upper-right corner. A connection dialog is displayed.

3. Click **Allow Access from Anywhere**.

For more details about how to obtain the connection string, refer to [TiDB Dedicated standard connection](https://docs.pingcap.com/tidbcloud/connect-via-standard-connection).

4. Launch Navicat and click the **Connection** in the upper-left corner. In the selection panel, click **MySQL** as the database type.
Icemap marked this conversation as resolved.
Show resolved Hide resolved

![Navicat: add new connection](/media/develop/navicat-add-new-connection.jpg)

5. In the setting panel, configure the following connection parameters:

- **Connection Name**: give this connection a meaningful name.
- **Host**: enter the `host` parameter from the TiDB Cloud connection dialog.
- **Port**: enter the `port` parameter from the TiDB Cloud connection dialog.
- **Username**: enter the `user` parameter from the TiDB Cloud connection dialog.
Icemap marked this conversation as resolved.
Show resolved Hide resolved
- **Password**: enter the password of the TiDB Dedicated cluster.

![Navicat: configure connection general panel for TiDB Dedicated](/media/develop/navicat-connection-config-dedicated-general.png)

Icemap marked this conversation as resolved.
Show resolved Hide resolved
6. **Test Connection** to validate the connection to the TiDB Dedicated cluster.

7. If the connection test is successful, you can see the **Connection Successful** message. Click **Save** to save the connection configuration.

</div>
<div label="TiDB Self-Hosted">

1. Launch Navicat and click the **Connection** in the upper-left corner. In the selection panel, click **MySQL** as the database type.
Icemap marked this conversation as resolved.
Show resolved Hide resolved

![Navicat: add new connection](/media/develop/navicat-add-new-connection.jpg)

2. In the setting pane, configure the following connection parameters:
Icemap marked this conversation as resolved.
Show resolved Hide resolved

- **Connection Name**: give this connection a meaningful name.
- **Host**: enter the IP address or domain name of your TiDB Self-Hosted cluster.
- **Port**: enter the port number of your TiDB Self-Hosted cluster.
- **Username**: enter the username to use to connect to your TiDB.
Icemap marked this conversation as resolved.
Show resolved Hide resolved
- **Password**: enter the password to use to connect to your TiDB.

![Navicat: configure connection general panel for self-hosted TiDB](/media/develop/navicat-connection-config-self-hosted-general.png)

3. **Test Connection** to validate the connection to the self-hosted TiDB.
Icemap marked this conversation as resolved.
Show resolved Hide resolved

4. If the connection test is successful, you can see the **Connection Successful** message. Click **Save** to save the connection configuration.
Icemap marked this conversation as resolved.
Show resolved Hide resolved

</div>
</SimpleTab>

## Next steps

- Learn the best practices for TiDB application development with the chapters in the [Developer guide](/develop/dev-guide-overview.md), such as [Insert data](/develop/dev-guide-insert-data.md), [Update data](/develop/dev-guide-update-data.md), [Delete data](/develop/dev-guide-delete-data.md), [Single table reading](/develop/dev-guide-get-data-from-single-table.md), [Transactions](/develop/dev-guide-transaction-overview.md), and [SQL performance optimization](/develop/dev-guide-optimize-sql-overview.md).
- Learn through the professional [TiDB developer courses](https://www.pingcap.com/education/) and earn [TiDB certifications](https://www.pingcap.com/education/certification/) after passing the exam.

## Need help?

Ask questions on the [Discord](https://discord.gg/vYU9h56kAX), or [create a support ticket](https://support.pingcap.com/).
Icemap marked this conversation as resolved.
Show resolved Hide resolved
Binary file added media/develop/navicat-add-new-connection.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Icemap marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Icemap marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading