Getting Username, Password and DB Being Presently Used

What is the easiest way to get the present username, password and db name being used? Is this info being stored in an object?

I want the information to run a mysql command to export data onto server using system("')

Thanks :slight_smile:

ActiveRecord::Base.configurations will return a hash that has the information you need. ActiveRecord::Base.configurations['test'], for example, will return the DB settings for your test environment.

- Gabriel

ahhh... very cool... now how do I know which environment I am in? :slight_smile:

The constant RAILS_ENV has the current environment.

- Gabriel