Get the code, build, and run
Last updated
Was this helpful?
Last updated
Was this helpful?
git
: The TiDB source code is hosted on GitHub as a git repository. To work with the git repository, please .
go
: TiDB is a Go project. Therefore, you need a working Go environment to build it. See the previous section to prepare the environment.
gcc
: gcc
command is required to use cgo
while building. To install gcc
, search for appropriate install guide for your OS.
mysql
client (optional): After building TiDB from source, you can use the official to connect to TiDB. It is not required if you want to build TiDB only.
Note:
TiDB could compile and run on Windows 10. However, it is not expected to be deployed on Windows, where you might encounter many compatibility problems. To have a better experience, we recommend you first.
Clone the source code to your development machine:
Build TiDB from the source code:
Now that you have the tidb-server
binary under the bin
directory, execute it for a TiDB server instance:
This starts the TiDB server listening on port 4000 with embedded unistore
.
You can use the official MySQL client to connect to TiDB:
where
-h 127.0.0.1
sets the Host to local host loopback interface
-P 4000
uses port 4000
-u root
connects as root user (-p
not given; the development build has no password for root.)
-D test
uses the Schema/Database test
--prompt "tidb> "
sets the prompt to distinguish it from a connection to MySQL
--comments
preserves comments like /*T![clustered_index NONCLUSTERED */
instead of stripping them when sending the query to the server.
If you encounter any problems during your journey, do not hesitate to reach out on the .