day-43mysql

一:pymysql (Python操作MySQL)
  方法:pip3 install pymysql
注意:

  a. conn, cursor 用完了需要关闭资源连接

  b. 查询的时候, fetchone, fetchmany, fetchall, 默认返回的是元组, 需要返回字典的话: cursor = conn.cursor(cursor=pymysql.cursors.DictCursor)

  c. 删除和更新的时候, 需要在execute之后, 添加 conn.commit()

  

      在cmd中  tee : 重定向导入某一个文件

原文地址:https://www.cnblogs.com/klw1/p/11025566.html