def call_sp_test(): delete_sql = "call sp_test()" # 打开数据库连接 db = pymysql.connect(host=insert_mysqlserver, user=insert_username, password=insert_password, port=3306,db=insert_dbname) # 使用 cursor() 方法创建一个游标对象 cursor cursor = db.cursor() try: cursor.execute(delete_sql) db.commit() except Exception as e: print(e) db.close()