# 使用 `Python` 连接到 `TiDB` 服务器实例
+ 导入`Connector/Python` 数据库驱动程序模块 - `mysql.connector` 
+ 通过将连接参数传递给驱动程序的`connect()` 函数来创建`MySQLConnection` 对象
+ 通过调用`MySQLConnection` 对象的`close()` 函数关闭连接
```
from mysql.connector import connect;
conn = connect(
  database='world',
  host='127.0.0.1',
  port=4000,
  user='root',
  password='so_hard_to_guess=('
)
print('Connected',conn)
conn.close()
print('Bye')
```
-----------------------------------------
