title: how to parse mysql database name from database_url
body: <p>DATABASE_URL- MYSQL://username:password@host:port/database_name    </p>
  
  <p>Error: database_name has no attributes.</p>
  
  <pre><code>if 'DATABASE_URL' in os.environ:
    url = urlparse(os.getenv['DATABASE_URL'])
   g['db'] = mysql.connector.connect(user=url.username,password=url.password, host=url.hostname ,port=url.port,path=url.path[1:])
  </code></pre>