title: Error trying to save new table to MySQL with sqlalchemy
body: <p>Hi does somebody has any troubleshooting ideas to solve this problem?</p>
  <p>I have a standard python-sql connection at my local machine:</p>
  <p><code>from sqlalchemy import create_engine</code></p>
  <p><code>engine = create_engine(&quot;mysql+pymysql://root:*******@localhost/my_DB&quot;)</code></p>
  <p><code>con = engine.connect()</code></p>
  <p>this DB consists of 200+ tables where I store stock/market information and I need to update it daily, in order to do that I usually construct a loop through all the tables to fetch up to date information from yahoo_finance using pandas datareader.</p>
  <p>Once loaded into a new DF I use</p>
  <p><code>df_new.to_sql(name = stock_ticker, con = con, if_exists = 'replace', index = False)</code></p>
  <p>to save the new table into my DB.</p>
  <p>The code above works just fine when I execute one by one, but when I try to implement the same idea on a loop it just breaks, sometimes on the very first instance of the loop:</p>
  <p><code>for stock in Stocks:</code></p>
  <p><code>    df_new = yahoo_quote(stock)</code></p>
  <p><code>    df_new.to_sql(name = stock_ticker, con = con, if_exists = 'replace', index = False)</code></p>
  <p>My first thought was that somehow I was exhuasting my machine/sql with so many calls, so I tried to add a time.sleep(5) and make sure I erased all the information from memory on each instance, but none of that seems to work. And, as I said, sometimes the computer just breaks on the very first loop.</p>
  <p>By &quot;break&quot; I mean that it just keeps running forever without saving the table, usually it takes little less than 1 second to save a table, but when this happens I can leave it running for 10+ minutes and it still won't save it.</p>