Commit 6366760b authored by catch's avatar catch

Issue #2536682 by eporama, r_sharma08, snehi, rakesh.gectcr, chegor,...

Issue #2536682 by eporama, r_sharma08, snehi, rakesh.gectcr, chegor, Prashant.c: default.settings.php database instructions need to be user friendly
parent dc111b40
...@@ -64,20 +64,36 @@ ...@@ -64,20 +64,36 @@
* to multiple databases, including multiple types of databases, * to multiple databases, including multiple types of databases,
* during the same request. * during the same request.
* *
* Each database connection is specified as an array of settings, * One example of the simplest connection array is shown below. To use the
* similar to the following: * sample settings, copy and uncomment the code below between the @code and
* @endcode lines and paste it after the $databases declaration. You will need
* to replace the database username and password and possibly the host and port
* with the appropriate credentials for your database system.
*
* The next section describes how to customize the $databases array for more
* specific needs.
*
* @code * @code
* array( * $databases['default']['default'] = array (
* 'driver' => 'mysql',
* 'database' => 'databasename', * 'database' => 'databasename',
* 'username' => 'username', * 'username' => 'sqlusername',
* 'password' => 'password', * 'password' => 'sqlpassword',
* 'host' => 'localhost', * 'host' => 'localhost',
* 'port' => 3306, * 'port' => '3306',
* 'prefix' => 'myprefix_', * 'driver' => 'mysql',
* 'prefix' => '',
* 'collation' => 'utf8mb4_general_ci', * 'collation' => 'utf8mb4_general_ci',
* ); * );
* @endcode * @endcode
*/
$databases = array();
/**
* Customizing database settings.
*
* Many of the values of the $databases array can be customized for your
* particular database system. Refer to the sample in the section above as a
* starting point.
* *
* The "driver" property indicates what Drupal database driver the * The "driver" property indicates what Drupal database driver the
* connection should use. This is usually the same as the name of the * connection should use. This is usually the same as the name of the
...@@ -118,19 +134,6 @@ ...@@ -118,19 +134,6 @@
* request as needed. The fourth line creates a new database with a name of * request as needed. The fourth line creates a new database with a name of
* "extra". * "extra".
* *
* For a single database configuration, the following is sufficient:
* @code
* $databases['default']['default'] = array(
* 'driver' => 'mysql',
* 'database' => 'databasename',
* 'username' => 'username',
* 'password' => 'password',
* 'host' => 'localhost',
* 'prefix' => 'main_',
* 'collation' => 'utf8mb4_general_ci',
* );
* @endcode
*
* You can optionally set prefixes for some or all database table names * You can optionally set prefixes for some or all database table names
* by using the 'prefix' setting. If a prefix is specified, the table * by using the 'prefix' setting. If a prefix is specified, the table
* name will be prepended with its value. Be sure to use valid database * name will be prepended with its value. Be sure to use valid database
...@@ -174,7 +177,6 @@ ...@@ -174,7 +177,6 @@
* connecting to the database server, as well as PDO connection settings. For * connecting to the database server, as well as PDO connection settings. For
* example, to enable MySQL SELECT queries to exceed the max_join_size system * example, to enable MySQL SELECT queries to exceed the max_join_size system
* variable, and to reduce the database connection timeout to 5 seconds: * variable, and to reduce the database connection timeout to 5 seconds:
*
* @code * @code
* $databases['default']['default'] = array( * $databases['default']['default'] = array(
* 'init_commands' => array( * 'init_commands' => array(
...@@ -186,38 +188,36 @@ ...@@ -186,38 +188,36 @@
* ); * );
* @endcode * @endcode
* *
* WARNING: These defaults are designed for database portability. Changing them * WARNING: The above defaults are designed for database portability. Changing
* may cause unexpected behavior, including potential data loss. * them may cause unexpected behavior, including potential data loss. See
* https://www.drupal.org/developing/api/database/configuration for more
* information on these defaults and the potential issues.
* *
* @see DatabaseConnection_mysql::__construct * More details can be found in the constructor methods for each driver:
* @see DatabaseConnection_pgsql::__construct * - \Drupal\Core\Database\Driver\mysql\Connection::__construct()
* @see DatabaseConnection_sqlite::__construct * - \Drupal\Core\Database\Driver\pgsql\Connection::__construct()
* - \Drupal\Core\Database\Driver\sqlite\Connection::__construct()
* *
* Database configuration format: * Sample Database configuration format for PostgreSQL (pgsql):
* @code * @code
* $databases['default']['default'] = array( * $databases['default']['default'] = array(
* 'driver' => 'mysql',
* 'database' => 'databasename',
* 'username' => 'username',
* 'password' => 'password',
* 'host' => 'localhost',
* 'prefix' => '',
* );
* $databases['default']['default'] = array(
* 'driver' => 'pgsql', * 'driver' => 'pgsql',
* 'database' => 'databasename', * 'database' => 'databasename',
* 'username' => 'username', * 'username' => 'sqlusername',
* 'password' => 'password', * 'password' => 'sqlpassword',
* 'host' => 'localhost', * 'host' => 'localhost',
* 'prefix' => '', * 'prefix' => '',
* ); * );
* @endcode
*
* Sample Database configuration format for SQLite (sqlite):
* @code
* $databases['default']['default'] = array( * $databases['default']['default'] = array(
* 'driver' => 'sqlite', * 'driver' => 'sqlite',
* 'database' => '/path/to/databasefilename', * 'database' => '/path/to/databasefilename',
* ); * );
* @endcode * @endcode
*/ */
$databases = array();
/** /**
* Location of the site configuration files. * Location of the site configuration files.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment