# Do you grant privileges for db:create and friends?

**URL:** <https://www.ruby-forum.com/t/do-you-grant-privileges-for-db-create-and-friends/123205>\
**Category:** Rails\
**Created:** [December 14, 2007, 10:28pm UTC](https://www.ruby-forum.com/t/do-you-grant-privileges-for-db-create-and-friends/123205 "2007-12-14T22:28:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fxn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/77aa72/32.png) [@fxn](https://www.ruby-forum.com/u/fxn)\
**Post date:** [December 14, 2007, 10:28pm UTC](https://www.ruby-forum.com/t/do-you-grant-privileges-for-db-create-and-friends/123205/1 "2007-12-14T22:28:47Z")

</div>

Before the new db tasks I used as anyone a custom task. It used  
IO.popen(“mysql -u root -p”, ‘w’) to pipe SQL based on  
ActiveRecord::Base.configurations[RAILS\_ENV]. The new db tasks assume  
the configured user can create and drop databases. Do you people  
actually grant those privileges?

– fxn

---

<div class="post-metadata">

**Author:** ![fxn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/77aa72/32.png) [@fxn](https://www.ruby-forum.com/u/fxn)\
**Post date:** [December 15, 2007, 8:14am UTC](https://www.ruby-forum.com/t/do-you-grant-privileges-for-db-create-and-friends/123205/2 "2007-12-15T08:14:54Z")

</div>

On Dec 14, 2007 8:03 PM, Brian H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’d like to know that too.
> 
> I assume that most people are going with the root / no-password database.yml  
> defaults… but that’s a really good question.

I don’t think there’s any particular benefit to restricting  
capabilities on my local dev box. I use the MySQL root user with no  
password for all my Rails projects. Staging and production are a  
different matter entirely, of course. 🙂

~ j.

---

<div class="post-metadata">

**Author:** ![fxn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/77aa72/32.png) [@fxn](https://www.ruby-forum.com/u/fxn)\
**Post date:** [December 15, 2007, 5:03am UTC](https://www.ruby-forum.com/t/do-you-grant-privileges-for-db-create-and-friends/123205/3 "2007-12-15T05:03:51Z")

</div>

I’d like to know that too.

I assume that most people are going with the root / no-password  
database.ymldefaults… but that’s a really good question.
