CRM/webman/config/database.php

81 lines
3.6 KiB
PHP
Raw Normal View History

2025-03-11 13:34:12 +08:00
<?php
return [
// 默认数据库
'default' => 'mysql',
// 各种数据库配置
'connections' => [
'mysql' => [
'driver' => 'mysql',
'host' => '127.0.0.1',
'port' => 3306,
2025-03-14 14:27:33 +08:00
'database' => 'xyh_crm',
2025-03-11 13:34:12 +08:00
'username' => 'root',
2025-03-14 14:27:33 +08:00
'password' => 'root',
2025-03-11 13:34:12 +08:00
'unix_socket' => '',
'charset' => 'utf8',
2025-03-14 14:27:33 +08:00
'collation' => 'utf8_unicode_ci',
2025-03-11 13:34:12 +08:00
'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秒
],
],
2025-03-14 14:27:33 +08:00
/*'sqlite' => [
2025-03-11 13:34:12 +08:00
'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秒
],
2025-03-14 14:27:33 +08:00
],*/
2025-03-11 13:34:12 +08:00
],
];