# -*- coding:utf-8 -*- import pymysql class mysql: def __init__(self, host, port, dbuser, dbpwd, dbname): self.host = host self.port = port self.dbuser = dbuser self.dbpwd = dbpwd self.dbname = dbname self._conn = None self.Connect() # 默认链接数据库, 最后要调用…