# Connecting to `TiDB` Server

__*TiDB connection*__
__*zz-BGL*__

+ A `TiDB` account is defined in terms of a `username` and the client host(s) from which the user can connect to the server
+ The account also has a password
+ For example, using MySQL Client to connect to TiDB server:
  + **`mysql -u {username} -p {password} -h {tidb_server} -P {tidb_server_port}`**

-------------------------------------------------------------
Here we need to distinguish between two addresses (hostname):
- One is the address defined in the `mysql.user` table. This address refers to the machine where the user client is connect from. Generally, it does not refer to the `TiDB` server host, so it is called the client address. 
- The other is the server address (hostname) where the database is located. This is what we need to specify when connecting as shown on the slide as `<tidb-server>`.