title: can't make the db work on localhost with flask
body: <p>I am using now the most basic code and it is still not working:</p>
  
  <pre><code>from flask import Flask, render_template
  from flaskext.mysql import MySQL
  
  mysql = MySQL()
  app = Flask(__name__)
  
  # MySQL configurations
  app.config['MYSQL_DATABASE_USER'] = 'root'
  app.config['MYSQL_DATABASE_PASSWORD'] = ''
  app.config['MYSQL_DATABASE_DB'] = 'people'
  app.config['MYSQL_DATABASE_HOST'] = 'localhost'
  mysql.init_app(app)
  
  @app.route('/test')
  def test():
      conn = mysql.connect()
      cursor = conn.cursor()
      sql = "SELECT * from tbl_user"
      cursor.execute(sql)
      results = cursor.fetchall()
      cursor.close()
      conn.close()
      return results
  
  if __name__ == "__main__":
      app.run(debug=True)
  </code></pre>
  
  <p>I have tried to connect on localhost to my db via Mysql cli and it works fine. I have used mysql -u root to enter and it accepts it then I use use people and it works fine then I can do select statements.</p>
  
  <p>Here is the error I get:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Python27\lib\site-packages\flask\app.py", line 1836, in __call__
      return self.wsgi_app(environ, start_response)
    File "C:\Python27\lib\site-packages\flask\app.py", line 1820, in wsgi_app
      response = self.make_response(self.handle_exception(e))
    File "C:\Python27\lib\site-packages\flask\app.py", line 1403, in handle_exception
      reraise(exc_type, exc_value, tb)
    File "C:\Python27\lib\site-packages\flask\app.py", line 1817, in wsgi_app
      response = self.full_dispatch_request()
    File "C:\Python27\lib\site-packages\flask\app.py", line 1478, in full_dispatch_request
      response = self.make_response(rv)
    File "C:\Python27\lib\site-packages\flask\app.py", line 1577, in make_response
      rv = self.response_class.force_type(rv, request.environ)
    File "C:\Python27\lib\site-packages\werkzeug\wrappers.py", line 847, in force_type
      response = BaseResponse(*_run_wsgi_app(response, environ))
    File "C:\Python27\lib\site-packages\werkzeug\wrappers.py", line 57, in _run_wsgi_app
      return _run_wsgi_app(*args)
    File "C:\Python27\lib\site-packages\werkzeug\test.py", line 871, in run_wsgi_app
      app_rv = app(environ, start_response)
  TypeError: 'tuple' object is not callable
  </code></pre>
  
  <p>But as you can see, as soon as I use Flask, I get this error.</p>