Install Instructions for Production Environment using:

Binary lgoo Tiup logo K8s logo Docker logo AWS logo GCP logo Terraform logo

Developer Local Install Instructions:

icon
  1. Download and install TiUP:

    curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
    
  2. Declare the global environment variable:

    Note:

    After the installation, TiUP displays the absolute path of the corresponding profile file. You need to modify the following source command according to the path.

    source .bash_profile
    
  3. Start the cluster in the current session:

    • If you want to start a TiDB cluster of the latest version with 1 TiDB instance, 1 TiKV instance, and 1 PD instance, run the following command:

      tiup playground
      
    • If you want to specify the TiDB version and the number of the instances of each component, run a command like this:

      tiup playground v4.0.0-rc --db 2 --pd 3 --kv 3 --monitor
      

      The command downloads a v4.0.0-rc cluster to the local machine and starts it.

      --monitor means that the monitoring component is also deployed.

      This command returns the access methods of the cluster:

      CLUSTER START SUCCESSFULLY, Enjoy it ^-^
      To connect TiDB: mysql --host 127.0.0.1 --port 4000 -u root
      To connect TiDB: mysql --host 127.0.0.1 --port 4001 -u root
      To view the dashboard: http://127.0.0.1:2379/dashboard
      To view the monitor: http://127.0.0.1:9090
      
  4. Start a new session to access TiDB:

    mysql --host 127.0.0.1 --port 4000 -u root
    

Homebrew install instructions:

  1. Install Homebrew.

  2. Install TiDB:

    brew tap pingcap/brew
    
    brew install tidb-server
    
  3. Start TiDB:

    tidb-server
    
  4. If you would like to connect a MySQL client to TiDB:

    brew install mysql-client
    
    mysql -h 127.0.0.1 -P4000 -uroot
    

DBdeployer instructions:

  1. Install DBdeployer.

  2. Install MySQL 5.7:

    curl -LO https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.25-macos10.14-x86_64.tar.gz
    
    dbdeployer unpack mysql-5.7.25-macos10.14-x86_64.tar.gz
    
  3. Install TiDB:

    curl -O https://download.pingcap.org/tidb-master-darwin-amd64.tar.gz
    
    dbdeployer unpack mysql-5.7.25-macos10.14-x86_64.tar.gz
    
    dbdeployer deploy single 3.0.0 --client-from=5.7.25
    
icon
  1. Download and install TiUP:

    curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
    
  2. Declare the global environment variable:

    Note:

    After the installation, TiUP displays the absolute path of the corresponding profile file. You need to modify the following source command according to the path.

    source .bash_profile
    
  3. Start the cluster in the current session:

    • If you want to start a TiDB cluster of the latest version with 1 TiDB instance, 1 TiKV instance, and 1 PD instance, run the following command:

      tiup playground
      
    • If you want to specify the TiDB version and the number of the instances of each component, run a command like this:

      tiup playground v4.0.0-rc --db 2 --pd 3 --kv 3 --monitor
      

      The command downloads a v4.0.0-rc cluster to the local machine and starts it.

      --monitor means that the monitoring component is also deployed.

      This command returns the access methods of the cluster:

      CLUSTER START SUCCESSFULLY, Enjoy it ^-^
      To connect TiDB: mysql --host 127.0.0.1 --port 4000 -u root
      To connect TiDB: mysql --host 127.0.0.1 --port 4001 -u root
      To view the dashboard: http://127.0.0.1:2379/dashboard
      To view the monitor: http://127.0.0.1:9090
      
  4. Start a new session to access TiDB:

    mysql --host 127.0.0.1 --port 4000 -u root
    

Homebrew install instructions:

  1. Install Homebrew.

  2. Install TiDB:

    brew tap pingcap/brew
    
    brew install tidb-server
    
  3. Start TiDB:

    tidb-server
    
  4. If you would like to connect a MySQL client to TiDB:

    brew install mysql-client
    
    mysql -h 127.0.0.1 -P4000 -uroot
    

DBdeployer instructions:

  1. Install DBdeployer.

  2. Install MySQL 5.7:

    dbdeployer remote get mysql-5.7.25
    
    dbdeployer unpack mysql-5.7.25.tar.xz
    
  3. Install TiDB:

    wget https://download.pingcap.org/tidb-master-linux-amd64.tar.gz
    
    dbdeployer unpack tidb-master-linux-amd64.tar.gz --unpack-version=3.0.0
    
    dbdeployer deploy single 3.0.0 --client-from=5.7.25
    
icon

Homebrew install instructions (via Windows Subsystem for Linux):

  1. Install Homebrew.

  2. Install TiDB:

    brew tap pingcap/brew
    
    brew install tidb-server
    
  3. Start TiDB:

    tidb-server
    
  4. If you would like to connect a MySQL client to TiDB:

    brew install mysql-client
    
    mysql -h 127.0.0.1 -P4000 -uroot