Commit 8f27898d by 杨树贤

修改数据库配置,添加主从和持久化

parent be5486a7
Showing with 33 additions and 1 deletions
......@@ -41,7 +41,12 @@ return [
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'read' => [
'host' => env('DB_HOST')
],
'write' => [
'host' => env('DB_HOST')
],
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
......@@ -52,8 +57,35 @@ return [
'prefix' => env('DB_PREFIX',''),
'strict' => true,
'engine' => null,
'sticky' => true,//防止主从同步不及时
'options' => [
// 开启持久连接
\PDO::ATTR_PERSISTENT => true,
],
],
// 'ic_inquiry' => [
// 'driver' => 'mysql',
// 'database' => env('DB_DATABASE', ''),
// 'read' => [
// 'host' => env('DB_HOST_R')
// ],
// 'write' => [
// 'host' => env('DB_HOST_W')
// ],
// 'username' => env('DB_USERNAME', ''),
// 'password' => env('DB_PASSWORD', ''),
// 'port' => env('DB_PORT', 3306),
// 'charset' => 'utf8',
// 'collation' => 'utf8_general_ci',
// 'prefix' => env('DB_PREFIX', 'ic_'),
// 'sticky' => true,//防止主从同步不及时
// 'options' => [
// // 开启持久连接
// \PDO::ATTR_PERSISTENT => true,
// ],
// ],
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', '127.0.0.1'),
......
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 sign in to comment