python——mysql——pymysql
pymysql
self.conn = pymysql.connect(host=self.host, port=int(self.port), user=self.user, passwd=self.passwd, db=db)
self.cursor = self.conn.cursor()
self.conn_mysql(self.db_ofss)
self.cursor.execute(sql,str_list)
retult = self.cursor.fetchall()
self.cursor.close()
self.conn.close()