# Change Database Name

**URL:** <https://www.ruby-forum.com/t/change-database-name/158846>\
**Category:** Rails\
**Created:** [January 28, 2009, 6:33pm UTC](https://www.ruby-forum.com/t/change-database-name/158846 "2009-01-28T18:33:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eada6e/32.png) [@dan](https://www.ruby-forum.com/u/dan)\
**Post date:** [January 28, 2009, 6:33pm UTC](https://www.ruby-forum.com/t/change-database-name/158846/1 "2009-01-28T18:33:15Z")

</div>

Hi,

I’d like to change the name of the database for an app I have in  
production (the current name is too ambiguous). As I see it I will need  
to change the database.yml file and the database name in mysql. Is there  
anything else? A better way? Suggestions?

I want to be on the cautious side, for obvious reasons.

Thanks.

---

<div class="post-metadata">

**Author:** ![dan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eada6e/32.png) [@dan](https://www.ruby-forum.com/u/dan)\
**Post date:** [January 28, 2009, 6:51pm UTC](https://www.ruby-forum.com/t/change-database-name/158846/2 "2009-01-28T18:51:29Z")

</div>

Dan Weaver wrote:

> Hi,
> 
> I’d like to change the name of the database for an app I have in  
> production (the current name is too ambiguous). As I see it I will need  
> to change the database.yml file and the database name in mysql. Is there  
> anything else? A better way? Suggestions?
> 
> I want to be on the cautious side, for obvious reasons.
> 
> Thanks.

You could copy the database to the new name, and then change  
database.yml.

Then you can delete the original database without any downtime.

HTH

Matt

---

<div class="post-metadata">

**Author:** ![dan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eada6e/32.png) [@dan](https://www.ruby-forum.com/u/dan)\
**Post date:** [January 28, 2009, 6:55pm UTC](https://www.ruby-forum.com/t/change-database-name/158846/3 "2009-01-28T18:55:51Z")

</div>

Matt H. wrote:

> You could copy the database to the new name, and then change  
> database.yml.
> 
> Then you can delete the original database without any downtime.
> 
> HTH
> 
> Matt

Good suggestion, thank you.
