title: Insert pandas dataframe to mysql using sqlalchemy
body: <p>I simply try to write a pandas dataframe to local mysql database on ubuntu.</p>
  
  <pre><code>from sqlalchemy import create_engine
  import tushare as ts
  
  df = ts.get_tick_data('600848', date='2014-12-22')
  engine = create_engine('mysql://user:passwd@127.0.0.1/db_name?charset=utf8')
  df.to_sql('tick_data',engine, flavor = 'mysql', if_exists= 'append')
  </code></pre>
  
  <p>and it pop the error</p>
  
  <pre><code>biggreyhairboy@ubuntu:~/git/python/fjb$ python tushareDB.py 
  Error on sql SHOW TABLES LIKE 'tick_data'
  Traceback (most recent call last):
   File "tushareDB.py", line 13, in &lt;module&gt;
     df.to_sql('tick_data', con = engine,flavor ='mysql', if_exists= 'append')
    File "/usr/lib/python2.7/dist-packages/pandas/core/frame.py", line 1261, in to_sql
      self, name, con, flavor=flavor, if_exists=if_exists, **kwargs)
    File "/usr/lib/python2.7/dist-packages/pandas/io/sql.py", line 207, in write_frame
      exists = table_exists(name, con, flavor)
    File "/usr/lib/python2.7/dist-packages/pandas/io/sql.py", line 275, in table_exists
      return len(tquery(query, con)) &gt; 0
    File "/usr/lib/python2.7/dist-packages/pandas/io/sql.py", line 90, in tquery
      cur = execute(sql, con, cur=cur)
    File "/usr/lib/python2.7/dist-packages/pandas/io/sql.py", line 53, in execute
      con.rollback()
  AttributeError: 'Engine' object has no attribute 'rollback'
  </code></pre>
  
  <p>the dataframe is not empty, database is ready without tables, i have tried other method to create table in python with mysqldb and it works fine.</p>
  
  <p>a related question:
  <a href="https://stackoverflow.com/questions/30631325/writing-to-mysql-database-with-pandas-using-sqlalchemy-to-sql">Writing to MySQL database with pandas using SQLAlchemy, to_sql</a>
  but no actual reason was explained</p>