我希望使用pymysql运行以下mysql脚本。
START TRANSACTION;
BEGIN;
insert into ~~~
COMMIT;
我的 Python 源代码是
connection = pymysql.connect(~~~~~~~)
with connection.cursor() as cursor :
connection.begin()
cursor.execute(~~.sql)
connection.commit()
connection.close()
我的问题是,"connection.begin()"和"START TRANSACTION; BEGIN;"是一样的吗?我想使用"START TRANSACTION; BEGIN;"