-
Notifications
You must be signed in to change notification settings - Fork 718
Add a connection tutorial for LibreDB Studio #23659
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
Open
kaya-abdullah
wants to merge
5
commits into
pingcap:master
Choose a base branch
from
kaya-abdullah:add-libredb-studio-gui-tutorial
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c0f2729
Add LibreDB Studio to the list of supported GUI tools
kaya-abdullah 5df0aaa
Add a connection tutorial for LibreDB Studio
kaya-abdullah 4806f60
Tighten TiDB Cloud scope note and add a verification query step
kaya-abdullah b04b10e
Pin the tested LibreDB Studio version in the prerequisites
kaya-abdullah 8752444
Document Node.js requirement, required privileges and TLS scope
kaya-abdullah File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| --- | ||
| title: Connect to TiDB with LibreDB Studio | ||
| summary: Learn how to connect to TiDB using LibreDB Studio. | ||
| aliases: ['/tidb/stable/dev-guide-gui-libredb-studio/','/tidb/dev/dev-guide-gui-libredb-studio/','/tidbcloud/dev-guide-gui-libredb-studio/'] | ||
| --- | ||
|
|
||
| # Connect to TiDB with LibreDB Studio | ||
|
|
||
| TiDB is a MySQL-compatible database, and [LibreDB Studio](https://libredb.org) is an open-source, web-based SQL IDE that connects to PostgreSQL, MySQL-compatible databases, and a number of other engines from a single workspace. It ships as a Docker image and as an `npx` package, so it runs next to the database instead of requiring a desktop install. | ||
|
|
||
| In this tutorial, you can learn how to connect to TiDB using LibreDB Studio. | ||
|
|
||
| > **Note:** | ||
| > | ||
| > This tutorial covers TiDB Self-Managed only. It was not tested against TiDB Cloud, so it does not include TiDB Cloud connection steps. | ||
| > | ||
| > It was also tested against a cluster that does not enforce TLS. The connection dialog has an **SSL / TLS** section with `SSL Mode` options (including CA certificate and client certificate/key fields) for clusters that enforce `require_secure_transport`, `REQUIRE SSL`, or `REQUIRE X509`, but that path was not tested here, so this tutorial leaves `SSL Mode` at its default. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| To complete this tutorial, you need: | ||
|
|
||
| - LibreDB Studio, started with `npx @libredb/studio@0.13.4` (requires Node.js 24 or later) or the Docker image (see the [Quick Start](https://github.com/libredb/libredb-studio#quick-start) instructions). | ||
| - A TiDB Self-Managed cluster, and a TiDB user with `CREATE`, `INSERT`, and `SELECT` privileges on the database used in this tutorial. | ||
|
|
||
| **If you don't have a TiDB cluster, you can deploy one as follows:** | ||
|
|
||
| - [Deploy a local test TiDB Self-Managed cluster](/quick-start-with-tidb.md#deploy-a-local-test-cluster) or [Deploy a production TiDB Self-Managed cluster](/production-deployment-using-tiup.md). | ||
|
|
||
| ## Connect to TiDB | ||
|
|
||
| 1. Open LibreDB Studio in your browser and sign in. | ||
|
|
||
| 2. Click the **+** button next to the LibreDB Studio logo in the top-left corner. This opens the **New Connection** dialog. | ||
|
|
||
|  | ||
|
|
||
| 3. Select **MySQL** as the database type. TiDB does not have its own entry in this list because LibreDB Studio talks to it over the same driver it uses for MySQL; once MySQL is selected, a note under the type grid lists the wire-compatible engines that driver has been verified against, including the exact TiDB build LibreDB Studio was tested with. | ||
|
|
||
|  | ||
|
|
||
| 4. Configure the following connection parameters: | ||
|
|
||
| - **Connection Name**: give this connection a meaningful name, such as `TiDB`. | ||
| - **Host & Instance**: enter the host and port of your TiDB cluster. The default TiDB port is `4000`. | ||
| - **Username**: enter the username to connect to your TiDB cluster. | ||
| - **Password**: enter the password for that username, if one is set. | ||
| - **Database Name**: enter the name of an existing database on the cluster, such as `test`. | ||
|
|
||
| The following figure shows an example of the connection parameters: | ||
|
|
||
|  | ||
|
|
||
| 5. Click **Test Connection** to validate the connection to your TiDB cluster. | ||
|
|
||
| 6. Click **Establish Connection** to save the connection and open it. | ||
|
|
||
| 7. In the query editor, run a statement to confirm the connection works end to end, for example: | ||
|
|
||
| ```sql | ||
| CREATE TABLE demo_users (id INT PRIMARY KEY, name VARCHAR(50)); | ||
| INSERT INTO demo_users VALUES (1, 'Ada'), (2, 'Grace'); | ||
| SELECT * FROM demo_users; | ||
| ``` | ||
|
|
||
| Click **RUN** (or press **Ctrl+Enter**) to execute it. | ||
|
|
||
|  | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| > **Note:** | ||
| > | ||
| > Right after you create a table and insert rows, the row count and size shown next to the table in the sidebar can briefly read `0` until TiDB's background statistics collection catches up. This is TiDB's own behavior, not something LibreDB Studio gets wrong, and the numbers correct themselves shortly afterward with no action needed. | ||
|
|
||
| ## Next steps | ||
|
|
||
| - Learn more usage of LibreDB Studio from its [documentation](https://github.com/libredb/libredb-studio/tree/main/docs). | ||
| - Learn the best practices for TiDB application development with the chapters in the [Developer guide](https://docs.pingcap.com/developer/), 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 the community on [Discord](https://discord.gg/DQZ2dy3cuc?utm_source=doc) or [Slack](https://slack.tidb.io/invite?team=tidb-community&channel=everyone&ref=pingcap-docs). | ||
| - [Submit a support ticket for TiDB Cloud](https://tidb.support.pingcap.com/servicedesk/customer/portals) | ||
| - [Submit a support ticket for TiDB Self-Managed](/support.md) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.