2025.3.11
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
return [
|
||||
// 默认数据库
|
||||
'default' => 'mysql',
|
||||
// 各种数据库配置
|
||||
'connections' => [
|
||||
|
||||
'mysql' => [
|
||||
'driver' => 'mysql',
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 3306,
|
||||
'database' => 'root',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'unix_socket' => '',
|
||||
'charset' => 'utf8',
|
||||
'collation' => 'utf8mb4_general_ci',
|
||||
'prefix' => '',
|
||||
'strict' => true,
|
||||
'engine' => null,
|
||||
'pool' => [ // 连接池配置,仅支持swoole/swow驱动
|
||||
'max_connections' => 5, // 最大连接数
|
||||
'min_connections' => 1, // 最小连接数
|
||||
'wait_timeout' => 3, // 从连接池获取连接等待的最大时间,超时后会抛出异常
|
||||
'idle_timeout' => 60, // 连接池中连接最大空闲时间,超时后会关闭回收,直到连接数为min_connections
|
||||
'heartbeat_interval' => 50, // 连接池心跳检测时间,单位秒,建议小于60秒
|
||||
],
|
||||
],
|
||||
|
||||
'sqlite' => [
|
||||
'driver' => 'sqlite',
|
||||
'database' => '',
|
||||
'prefix' => '',
|
||||
'pool' => [ // 连接池配置,仅支持swoole/swow驱动
|
||||
'max_connections' => 5, // 最大连接数
|
||||
'min_connections' => 1, // 最小连接数
|
||||
'wait_timeout' => 3, // 从连接池获取连接等待的最大时间,超时后会抛出异常
|
||||
'idle_timeout' => 60, // 连接池中连接最大空闲时间,超时后会关闭回收,直到连接数为min_connections
|
||||
'heartbeat_interval' => 50, // 连接池心跳检测时间,单位秒,建议小于60秒
|
||||
],
|
||||
],
|
||||
|
||||
'pgsql' => [
|
||||
'driver' => 'pgsql',
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 5432,
|
||||
'database' => 'webman',
|
||||
'username' => 'webman',
|
||||
'password' => '',
|
||||
'charset' => 'utf8',
|
||||
'prefix' => '',
|
||||
'schema' => 'public',
|
||||
'sslmode' => 'prefer',
|
||||
'pool' => [ // 连接池配置,仅支持swoole/swow驱动
|
||||
'max_connections' => 5, // 最大连接数
|
||||
'min_connections' => 1, // 最小连接数
|
||||
'wait_timeout' => 3, // 从连接池获取连接等待的最大时间,超时后会抛出异常
|
||||
'idle_timeout' => 60, // 连接池中连接最大空闲时间,超时后会关闭回收,直到连接数为min_connections
|
||||
'heartbeat_interval' => 50, // 连接池心跳检测时间,单位秒,建议小于60秒
|
||||
],
|
||||
],
|
||||
|
||||
'sqlsrv' => [
|
||||
'driver' => 'sqlsrv',
|
||||
'host' => 'localhost',
|
||||
'port' => 1433,
|
||||
'database' => 'webman',
|
||||
'username' => 'webman',
|
||||
'password' => '',
|
||||
'charset' => 'utf8',
|
||||
'prefix' => '',
|
||||
'pool' => [ // 连接池配置,仅支持swoole/swow驱动
|
||||
'max_connections' => 5, // 最大连接数
|
||||
'min_connections' => 1, // 最小连接数
|
||||
'wait_timeout' => 3, // 从连接池获取连接等待的最大时间,超时后会抛出异常
|
||||
'idle_timeout' => 60, // 连接池中连接最大空闲时间,超时后会关闭回收,直到连接数为min_connections
|
||||
'heartbeat_interval' => 50, // 连接池心跳检测时间,单位秒,建议小于60秒
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
Reference in New Issue
Block a user