title: Pandas read_sql() - AttributeError: 'Engine' object has no attribute 'cursor'
body: <p>I am trying to read data from MySQL query using pandas read_sql() method with python3+sqlalchemy+pymysql</p>
  
  <p>I tried to follow the following tutorials -</p>
  
  <p><a href="https://pythondata.com/quick-tip-sqlalchemy-for-mysql-and-pandas/" rel="noreferrer">https://pythondata.com/quick-tip-sqlalchemy-for-mysql-and-pandas/</a></p>
  
  <p><a href="https://www.youtube.com/watch?v=M-4EpNdlSuY" rel="noreferrer">https://www.youtube.com/watch?v=M-4EpNdlSuY</a></p>
  
  <p><a href="https://www.programcreek.com/python/example/101381/pandas.read_sql" rel="noreferrer">https://www.programcreek.com/python/example/101381/pandas.read_sql</a></p>
  
  <p>Everything just looks good with the code</p>
  
  <pre class="lang-py prettyprint-override"><code>import pandas
  import sqlalchemy
  engine = sqlalchemy.create_engine('mysql+pymysql://root:mypass@example.com:3306/mydatabase')
  df = pandas.read_sql("SELECT * FROM persons", con = engine)
  </code></pre>
  
  <p>Receiving following error -</p>
  
  <blockquote>
    <p>AttributeError: 'Engine' object has no attribute 'cursor'</p>
  </blockquote>
  
  <p>When I tried to pass the 'connection' variable instead of the 'engine', like below -</p>
  
  <pre class="lang-py prettyprint-override"><code>import pandas
  import sqlalchemy
  engine = sqlalchemy.create_engine('mysql+pymysql://root:mypass@example.com:3306/mydatabase')
  connection = engine.connect()
  df = pandas.read_sql("SELECT * FROM persons", con = connection)
  </code></pre>
  
  <p>it says -</p>
  
  <blockquote>
    <p>AttributeError: 'Connection' object has no attribute 'cursor'</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>