Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/pingcap/tidb/llms.txt

Use this file to discover all available pages before exploring further.

TiDB is a distributed SQL database that handles both transactional and analytical workloads simultaneously. It’s fully compatible with MySQL 8.0 protocols, so you can connect with any MySQL driver or ORM without changing your application code.

Quick Start

Deploy a local TiDB cluster and run your first queries in minutes.

Architecture

Understand how TiDB’s distributed components work together.

SQL Reference

Explore TiDB’s SQL capabilities, DDL, DML, and advanced features.

HTTP API

Use the TiDB HTTP API for monitoring and administration.

Why TiDB?

Distributed Transactions

ACID-compliant distributed transactions spanning multiple nodes with two-phase commit.

HTAP

Run transactional and analytical queries on the same dataset with no ETL.

High Availability

Raft consensus protocol with automated failover and geographic redundancy.

MySQL Compatible

Connect with any MySQL 8.0 driver, ORM, or tool — no code changes required.

Get Up and Running

1

Deploy TiDB

Start a local TiDB cluster using TiUP playground — no infrastructure setup required.
curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
tiup playground
2

Connect with MySQL client

TiDB listens on port 4000 and accepts standard MySQL connections.
mysql -h 127.0.0.1 -P 4000 -u root
3

Create your first table

Use standard MySQL syntax to create tables and insert data.
CREATE DATABASE myapp;
USE myapp;
CREATE TABLE users (
  id BIGINT PRIMARY KEY AUTO_INCREMENT,
  name VARCHAR(255) NOT NULL,
  email VARCHAR(255) UNIQUE,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO users (name, email) VALUES ('Alice', 'alice@example.com');
SELECT * FROM users;
4

Explore advanced features

Discover HTAP, distributed transactions, vector search, and more in the documentation.

Deployment Options

Local Playground

Single-node cluster for development and testing.

Kubernetes

Production-grade deployment with TiDB Operator.

Configuration

Tune TiDB for your workload requirements.
TiDB is fully open source under the Apache 2.0 license. All enterprise-grade features are included in the open source distribution.

Build docs developers (and LLMs) love