Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
ic_server_welfare
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8f27898d
authored
Aug 13, 2019
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改数据库配置,添加主从和持久化
parent
be5486a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
1 deletions
config/database.php
config/database.php
View file @
8f27898d
...
...
@@ -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'
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment