import mysql.connector conn= mysql.connector.Connect( host='localhost', user='root', passwd='admin', database='testcode' ) print('1.',conn) cmd = conn.cursor() # 光标行 cmd.execute('''create table test( id int primary key auto_increment, sname char(10) not null, age int);''')