title: rails database_url escaping mysql2 url passwod
body: <p>So I am trying to set an environment variable for my rails production environment database as suggested in the .yml file. In my .bash_profile I export it like this:</p>
  
  <pre><code>export DATABASE_URL=mysql2://&lt;username&gt;:&lt;password&gt;@localhost/&lt;database&gt;
  </code></pre>
  
  <p>I go to my website and i get "<code>ActiveRecord::AdapterNotSpecified</code>" error.</p>
  
  <p>The only thing I can think of is that my password ends in an @ sign which would make the url have @@ and get confused where the password ends and the host begins?</p>
  
  <p>Also this app is hosted on Hostmonster if that helps</p>
  
  <p>database.yml:</p>
  
  <pre><code>default: &amp;default
    adapter: mysql2
    encoding: utf8
    pool: 5
    username: &lt;username&gt;
    password: &lt;password&gt;
    database: &lt;database&gt;
  
  development:
    &lt;&lt;: *default
    database: &lt;database&gt;
  
  # Warning: The database defined as "test" will be erased and
  # re-generated from your development database when you run "rake".
  # Do not set this db to the same as development or production.
  test:
    &lt;&lt;: *default
    database: &lt;database&gt;
  
  # Avoid production credentials in the repository,
  # instead read the configuration from the environment.
  #
  # Example:
  #   mysql2://myuser:mypass@localhost/somedatabase
  #
  production:
    url: &lt;%= ENV["DATABASE_URL"] %&gt;
  </code></pre>