当对数据库进行插入数据后,有时会需要刚插入的数据的id值,以作他用,整理如下: conn = pymysql.connect(, user=DB_USER, passwd=DB_PASSWORD, db=DB_DATABASE, charset=DB_CHARSET)cursor = conn.cursor()query = 'insert into bz_tag(name,type,`desc`,sort,status,created_at,updated_at) ' \ 'VALUES(%s