title: Can you get DB username, pw, database name in Rails?
body: <p>I'm writing a rake task that does some DB work outside of Rails/ActiveRecord.</p>
  
  <p>Is there a way to get the DB connection info (host, username, password, DB name) for the current environment as defined in <code>database.yml</code>?</p>
  
  <p>I'd like to get it so I can use it to connect like this...</p>
  
  <pre><code>con = Mysql.real_connect("host", "user", "pw", "current_db")
  </code></pre>