title: Creating a mysql database using sqlalchemy
body: <p>I'm trying to create a mysql database using sqlalchemy.</p>
  
  <p>I have a flask web app which contains an sqlite database. I'm trying to switch over to mysql. I'm fairly new to sqlalchemy and have learned how to create databases via sqlalchemy. However the databases were sqlite databases. I'm trying to use sqlalchemy to create a mysql database and after reading multiple posts i still can't seem to get it.</p>
  
  <p>I've also installed python-mysqldb</p>
  
  <p>Snippets of the original code used to create an sqlite database which was successful.</p>
  
  <pre><code>Base = declarative_base()
  
  class Categories(Base):
      __tablename__ = 'categories'
      id = Column(Integer, primary_key=True)
      name = Column(String, unique=True)
      image = Column(String)
      link = Column(String)
      description = Column(String)
  
  if __name__ =='__main__':
      engine = create_engine('sqlite:///app/database/main.db', echo=True)
      Base.metadata.create_all(engine)
  </code></pre>
  
  <p>mysql attempt </p>
  
  <pre><code>if __name__ =='__main__':
      engine = create_engine('mysql://user:password@localhost/app/database/main.db', echo=True)
      Base.metadata.create_all(engine)
  </code></pre>
  
  <p>mysql 2nd attempt</p>
  
  <pre><code>if __name__ =='__main__':
      engine = create_engine('mysql://user:password@localhost/app/database/main.db', echo=True)
      engine.execute("CREATE DATABASE main.db")
      engine.execute("USE main.db")
  </code></pre>
  
  <p>The error i keep receiving.</p>
  
  <pre><code>sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (1049, "Unknown database 'app/database/main.db'") (Background on this error at: http://sqlalche.me/e/e3q8)
  </code></pre>
  
  <p>My best guess is that there's clearly something i'm missing about using mysql with sqlalchemy.</p>
  
  <p>Any help to even point me in the right direction would be greatly appreciated.</p>