How can I do begin transaction in pymysql ? (mysql)
<p>I want to use run below mysql script using with pymysql.</p>

<pre><code>START TRANSACTION;
BEGIN;
insert into ~~~ 
COMMIT;
</code></pre>

<p>my python source code is </p>

<pre><code>connection = pymysql.connect(~~~~~~~)
     with connection.cursor() as cursor :
         connection.begin()
         cursor.execute(~~.sql)
         connection.commit()
connection.close()
</code></pre>

<p>My question is "connection.begin()" is the same thing "START TRANSACTION; BEGIN;" ? I want to use "START TRANSACTION; BEGIN;" </p>