Download TiDB JDBC Driver

Download the TiDB JDBC driver, copy the JDBC URL into DbSchema, and start designing schemas with ER diagrams — free Community Edition.

Connect TiDB in DbSchema Install the driver, open a connection, reverse engineer your schema, and sync changes visually.

About the TiDB JDBC driver

A JDBC driver is a Java .jar library that lets applications connect to TiDB. DbSchema uses JDBC to reverse engineer schemas, run SQL, and generate documentation. Driver files are usually published by the database vendor or an open-source project.

JDBC URL format

Host, port, database name, and SSL options are passed in a URL starting with jdbc:. Each TiDB driver uses its own syntax — see the connection details below.

The TiDB JDBC driver

TiDB is a distributed SQL database developed by PingCAP that combines OLTP and OLAP capabilities in a single platform, known as HTAP. It is MySQL-compatible, allowing existing MySQL applications to migrate with minimal changes, while providing horizontal scalability and high availability through its distributed architecture. TiDB separates storage (TiKV and TiFlash) from compute, enabling independent scaling of each tier.

The TiDB JDBC URL

  • Required File(s): mysql-connector-j-xxx.jar
  • Java Driver Class: com.mysql.cj.jdbc.Driver
  • JDBC URL: jdbc:mysql://{HOST}:{PORT}/{DB}
  • Website: TiDB by PingCAP

Connecting to a Self-Hosted TiDB

  1. Use port 4000, not 3306. Clients connect to a TiDB server node, which listens on 4000. The storage tier behind it, TiKV and TiFlash, is not something a SQL client talks to.
  2. Grant the user access from your host. TiDB keeps MySQL's user-plus-host accounts, so grant the address of the machine running DbSchema explicitly.
  3. Open port 4000 in the server's firewall. The database listens on port 4000 unless it was installed with a different one. A host firewall on the server blocks incoming connections on that port until a rule allows them. The firewall guide has the commands for Windows, ufw, firewalld and iptables.
  4. Connect from DbSchema. In the Connection Dialog choose Remote computer or custom port, fill in the server host and the port, then press Test Connection to check that the server answers before you connect.

TiDB Cloud

A managed cluster is reached over TLS from the public internet, and the console supplies the host, the port and a user.

  1. Allowlist your IP address in the cluster's network access settings.
  2. Keep TLS on. TiDB Cloud requires a secure connection. Its certificates come from Let's Encrypt, which Java already trusts, so no truststore has to be configured — sslMode=VERIFY_IDENTITY in the URL is enough. A Dedicated cluster with its own CA is the exception: download that CA and import it into a truststore with keytool first.
  3. Copy the JDBC URL from the TiDB Cloud console. You will find it in the cluster's Connect panel.
  4. Paste the URL into DbSchema. In the Connection Dialog set Connection Mode to Edit the JDBC URL Manually and paste the string you copied. The user and the password are entered in the first tab, not in the URL.

DbSchema and TiDB

DbSchema connects to TiDB using the MySQL JDBC driver, visualizing TiDB's distributed SQL schemas, enabling MySQL-compatible query authoring, and supporting schema design for both OLTP and HTAP workloads across TiKV and TiFlash storage engines.

Test the driver with DbSchema

Connect TiDB, build your first ER diagram in minutes. No account required.

1
Download driver & DbSchema

Get the TiDB driver zip below and install DbSchema for Windows, macOS, or Linux.

2
Register the .jar

In DbSchema, open Driver Manager, add the extracted JAR, and paste your JDBC URL.

3
Design & document

Reverse engineer TiDB, edit the model visually, and publish schema documentation.

Use TiDB visually in DbSchema

After the JDBC driver connects, you get ER diagrams, SQL editor, schema sync, and HTML documentation in one desktop app. Compare DbSchema editions.

ER diagrams

Reverse engineer TiDB into an interactive diagram and edit structures visually.

SQL & query builder

Run SQL with autocomplete or compose queries without writing every join by hand.

Schema documentation

Export HTML docs your team can browse without installing DbSchema.

Full TiDB guide

Connection tips, ports, SSL, and schema design workflows on the database landing page.

Other drivers teams often configure alongside TiDB.

Browse all JDBC driver downloads

Teams working with TiDB often use these engines too. Explore dedicated guides and JDBC setup for each.

Browse all 100+ supported databases