File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -278,8 +278,10 @@ The string form will be split on whitespace and parsed as with the array form:
278278Plain flags are added to the default flags, while flags prefixed with ` - `
279279(minus) are removed from the default flags.
280280
281- This allows easier use with ActiveRecord's database.yml, avoiding the need for magic flag numbers.
282- For example, to disable protocol compression, and enable multiple statements and result sets:
281+ ### Using Active Record's database.yml
282+
283+ Active Record typically reads its configuration from a file named ` database.yml ` or an environment variable ` DATABASE_URL ` .
284+ Use the value ` mysql2 ` as the adapter name. For example:
283285
284286``` yaml
285287development :
@@ -297,6 +299,15 @@ development:
297299 secure_auth : false
298300` ` `
299301
302+ ### Using Active Record's DATABASE_URL
303+
304+ Active Record typically reads its configuration from a file named ` database.yml` or an environment variable `DATABASE_URL`.
305+ Use the value `mysql2` as the protocol name. For example :
306+
307+ ` ` ` shell
308+ DATABASE_URL=mysql2://sql_user:sql_pass@sql_host_name:port/sql_db_name?option1=value1&option2=value2
309+ ` ` `
310+
300311# ## Reading a MySQL config file
301312
302313You may read configuration options from a MySQL configuration file by passing
You can’t perform that action at this time.
0 commit comments