# semicolon in yaml file

**URL:** <https://discuss.rubyonrails.org/t/semicolon-in-yaml-file/23659>\
**Category:** rubyonrails-talk\
**Created:** [January 22, 2008, 5:41pm UTC](https://discuss.rubyonrails.org/t/semicolon-in-yaml-file/23659 "2008-01-22T17:41:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Al11](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@Al11](https://discuss.rubyonrails.org/u/Al11)\
**Post date:** [January 22, 2008, 5:41pm UTC](https://discuss.rubyonrails.org/t/semicolon-in-yaml-file/23659/1 "2008-01-22T17:41:09Z")

</div>

How does one escape a semicolon in their database.yml file? One of our passwords have an embedded ";" character.

---

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [January 22, 2008, 9:59pm UTC](https://discuss.rubyonrails.org/t/semicolon-in-yaml-file/23659/2 "2008-01-22T21:59:44Z")

</div>

me wrote:

> How does one escape a semicolon in their database.yml file? One of our passwords have an embedded ";" character.

semi-colons are not reserved words in yaml and therefore don't need escaping [YAML Reference Card](http://www.yaml.org/refcard.html)

> > "text with embedded semi-colons such as ; and ; and even more ;".to\_yaml

=\> "--- text with embedded semi-colons such as ; and ; and even more ;\n"

hth

ilan

---

<div class="post-metadata">

**Author:** ![Justin\_Blake](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@Justin\_Blake](https://discuss.rubyonrails.org/u/Justin_Blake)\
**Post date:** [January 23, 2008, 3:35pm UTC](https://discuss.rubyonrails.org/t/semicolon-in-yaml-file/23659/3 "2008-01-23T15:35:50Z")

</div>

I've had trouble with certain characters in db passwords before too, even characters that weren't reserved or "special" for yaml. Wrapping it in quotes seems to do the trick.
