Getting Username, Password and DB Being Presently Used


#1

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:

–
John K.
removed_email_address@domain.invalid

http://www.kopanas.com
http://www.cusec.net
http://www.soen.info


#2

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

#3

The constant RAILS_ENV has the current environment.

  • Gabriel

#4

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

On 5/28/07, John K. removed_email_address@domain.invalid wrote:

On 5/28/07, John K. removed_email_address@domain.invalid wrote:

John K.

–
John K.
removed_email_address@domain.invalid

http://www.kopanas.com
http://www.cusec.net
http://www.soen.info

–
John K.
removed_email_address@domain.invalid

http://www.kopanas.com
http://www.cusec.net
http://www.soen.info