title: Get list of MySQL databases with python
body: <p>I'm trying to get the names of all databases associated with my MySQL server via python (2.7), but am instead just getting the number of databases.  </p>
  
  <p>I looked around, and it seems like the only answer may be to use <code>sys</code> for a command line call, get the name of the databases, and proceed from there, but I can't believe that's the only way.</p>
  
  <p><strong>Current Code:</strong></p>
  
  <pre><code>import MySQLdb
  
  serv = MySQLdb.connect(host = "localhost", user = "root", passwd = "abcdefg")
  
  c = serv.cursor()
  
  print c.execute("SHOW DATABASES")
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>4
  </code></pre>
  
  <p>Thanks in advance for the help.</p>