github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/libraries/pingcap/tidb/docs/QUICKSTART.md (about)

     1  # Quick Start
     2  
     3  #### Run TiDB with Docker
     4  
     5  You can quickly test TiDB with Docker, the source repository contains the Dockerfile which contains local tidb-server.
     6  
     7  Or you can pull TiDB Docker image contains HBase standalone and then run TiDB as a distributed database in a Docker container.
     8  
     9  To install Docker on your system, you can read the document on https://docs.docker.com/
    10  
    11  ```
    12  docker pull pingcap/tidb:latest
    13  docker run --name tidb-server -d -p 4000:4000 pingcap/tidb:latest
    14  ```
    15  
    16  `docker pull` may take a while to download images ~560M.
    17  
    18  Then you can use official mysql client to connect to TiDB.
    19  
    20  ```
    21  mysql -h 127.0.0.1 -P 4000 -u root -D test
    22  ```
    23  
    24  Notice: OS X user may use `docker-machine ip` to connect it.
    25  
    26  #### __Run TiDB on HBase__
    27  
    28  Read this [doc](https://github.com/pingcap/tidb/blob/master/docs/HBASE_QUICKSTART.md).
    29  
    30  #### __Pre-requirement__
    31  
    32  Go environment. Currently a 64-bit version of go >= 1.5 is required.
    33  ```
    34  git clone https://github.com/pingcap/tidb.git $GOPATH/src/github.com/pingcap/tidb
    35  cd $GOPATH/src/github.com/pingcap/tidb
    36  make
    37  ```
    38  
    39  #### __Run command line interpreter__
    40  
    41  Interpreter is an interactive command line TiDB client.
    42  You can just enter some SQL statements and get the result.
    43  ```
    44  make interpreter
    45  cd interpreter && ./interpreter
    46  ```
    47  Press `Ctrl+C` to quit.
    48  
    49  #### __Run as MySQL protocol server__
    50  
    51  ```
    52  make server
    53  cd tidb-server && ./tidb-server
    54  ```
    55  
    56  In case you want to compile a specific location:
    57  
    58  ```
    59  make server TARGET=$GOPATH/bin/tidb-server
    60  ```
    61  
    62  The default server port is `4000` and can be changed by flag `-P <port>`.
    63  
    64  Run `./tidb-server -h` to see more flag options.
    65  
    66  After you started tidb-server, you can use official `mysql` client to connect to TiDB.
    67  
    68  ```
    69  mysql -h 127.0.0.1 -P 4000 -u root -D test
    70  ```