# `Prepared Statements` 和 `Connector/Python`
+ 在 `Connector/Python`中使用`prepared statment`：
  + 创建`cursor` ,传入参数`prepared=True` 
  + 返回一个`MySQLCursorPrepared` 对象
+ 使用参数标记构建 SQL 语句字符串
+ 执行语句,为每个参数赋值
  + 第一次调用`execute()` 将准备语句
  + 后续调用`execute()` 即跳过准备阶段
```
connection = mysql.connector.connect(...)
cursor = connection.cursor(prepared=True)
sql_statement = "INSERT INTO test.t1 (col1, col2, col3) VALUES (%s, %s, %s)"
cursor.execute(sql_statement, (val1, val2, val3));
```
-------------------------------------------------------
