SQL语句就是传入不正规的内容。。。把别人的数据库中的数据取出来了。。。 def insert_info(self): info = input("请输入一条数据") sql="select * from goods where name=%s" self.cursor.execute(sql,[info]) self.conn.commit() 此处将输入的数据传入列表。一对一的传入对应位置。所有的地方都有可能会被SQL注入,达到脱裤的效果。