CRM/webman/config/database.php
2025-03-14 14:27:33 +08:00

81 lines
3.6 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
return [
// 默认数据库
'default' => 'mysql',
// 各种数据库配置
'connections' => [
'mysql' => [
'driver' => 'mysql',
'host' => '127.0.0.1',
'port' => 3306,
'database' => 'xyh_crm',
'username' => 'root',
'password' => 'root',
'unix_socket' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_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秒
],
],*/
],
];