title: How to retrieve data using Python and MySQL connector
body: <p>I have a MySQL database with a table holding a service (google, reddit, etc) and a password. I want to query the db (SELECT * FROM pwds) and add them to a Python dict, so that the key of the dict is the service, and the value the password. Passwords['google']='G4sR0*KMVC', for example. Here's what I have so far:</p>
  
  <pre><code>Passwords = {} #Dictionary to store service and password
  cnx = mysql.connector.connect(user='Bob', password='foobar', host='127.0.0.1', database='passwords')
  query = ("SELECT * FROM pwds")
  cursor = cnx.cursor(dictionary=True)
  cursor.execute(query)
  </code></pre>
  
  <p>When I run this in iPython, after the last step, I can see what's in the cursor
  <a href="https://i.stack.imgur.com/9xmiQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9xmiQ.png" alt="enter image description here"></a></p>
  
  <p>How can I get what's in the cursor in my dictionary? I've been trying unsuccessfully, and I can't figure it out.</p>