## Module 4: Connect To TiDB Instances

### Step 1. Connect to TiDB instance from the remote Linux

+ From the SSH session, connect to TiDB instance and modify the `root` user password. You should provide option `-p` if `root` has a password, otherwise you can omit the `-p` option.

   ```bash
   mysql -h ${HOST_DB1_PRIVATE_IP} --port 4000 -u root
   ```

   ```output
   mysql>
   ```

### Step 2. Execute SQL query

+ Verify the version of TiDB cluster.

  ```sql
  SELECT TIDB_VERSION(), VERSION(), NOW()\G
  ```

  ```output
  *************************** 1. row ***************************
  TIDB_VERSION(): Release Version: v8.1.1
  Edition: Community
  Git Commit Hash: a7df4f9845d5d6a590c5d45dad0dcc9f21aa8765
  Git Branch: HEAD
  UTC Build Time: 2024-08-22 05:50:03
  GoVersion: go1.21.13
  Race Enabled: false
  Check Table Before Drop: false
  Store: tikv
       VERSION(): 8.0.11-TiDB-v8.1.1
           NOW(): 2025-01-19 14:20:05
  1 row in set (0.00 sec)
  ```

### Step 3. Exit from mysql client to the Linux prompt

   ```sql
   EXIT;
   ```

   ```output
   Bye
   ```
