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:
278
278
Plain flags are added to the default flags, while flags prefixed with ` - `
279
279
(minus) are removed from the default flags.
280
280
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:
283
285
284
286
``` yaml
285
287
development :
@@ -297,6 +299,15 @@ development:
297
299
secure_auth : false
298
300
` ` `
299
301
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
+
300
311
# ## Reading a MySQL config file
301
312
302
313
You may read configuration options from a MySQL configuration file by passing
You can’t perform that action at this time.
0 commit comments