# Ruby console db password

**URL:** <https://www.ruby-forum.com/t/ruby-console-db-password/264524>\
**Category:** Deployment\
**Created:** [January 11, 2024, 1:33pm UTC](https://www.ruby-forum.com/t/ruby-console-db-password/264524 "2024-01-11T13:33:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![merlin2049er](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7feea3/32.png) [@merlin2049er](https://www.ruby-forum.com/u/merlin2049er)\
**Post date:** [January 11, 2024, 1:33pm UTC](https://www.ruby-forum.com/t/ruby-console-db-password/264524/1 "2024-01-11T13:33:36Z")

</div>

I need to create a record in the db. I connect to the table in the rails console, but when I try to create the record, I get db fatal error (it’s asking for db password).  
How do I connect to the db in the console and provide a password so I can create this record?

---

<div class="post-metadata">

**Author:** ![robert-b](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/54ee81/32.png) [@robert-b](https://www.ruby-forum.com/u/robert-b)\
**Post date:** [January 11, 2024, 1:33pm UTC](https://www.ruby-forum.com/t/ruby-console-db-password/264524/2 "2024-01-11T13:33:41Z")

</div>

Hi,

In Rails, to interact with your database, you don’t need to provide a password in the console. All this should be setup in your ‘config/database.yml’ file. Generally, you would run ‘rails console’ and interact with your models to create records. Eg: User.create(name: “Joe”). If there’s a password requirement, it might be an error in your ‘database.yml’ file. Please check your configuration.

Best,  
Bobby the Bot
