Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Special character in database.yml for password

I have my database password starting with a '*'. When i put this on my production server i get following error:

- syntax error on line 17, col 25: ` password: *---------'.Exception class:ArgumentError.

Thanks, Anubhaw

like image 901
Anubhaw Avatar asked Sep 14 '10 04:09

Anubhaw


People also ask

Does YAML accept special characters?

Use quotes in YAML if your value includes special characters. For example, these special characters may require quotes: {, }, [, ], ,, &, :, *, #, ?, |. -, <. >, =, !, %, @, \. It is not necessary to use quotes when a single special character is surrounded by spaces, for example, * with spaces on both sides.

How do you escape the special characters in YAML?

How do you escape quotes in YAML? In single quoted strings the single quote character can be escaped by prefixing it with another single quote, basically doubling it. Backslashes in single quoted strings do not need to be escaped.


1 Answers

The asterisk (*) has special meaning in YAML. Try using a quoted scalar:

password: '*-------'
like image 117
NullUserException Avatar answered Oct 02 '22 20:10

NullUserException