travel/service/config/thinkorm.php

38 lines
1.1 KiB
PHP
Raw Normal View History

2024-06-24 11:28:18 +08:00
<?php
return [
'default' => 'mysql',
'connections' => [
'mysql' => [
// 数据库类型
'type' => 'mysql',
// 服务器地址
2024-06-24 11:52:30 +08:00
'hostname' => getenv('DB_HOST','127.0.0.1'),
2024-06-24 11:28:18 +08:00
// 数据库名
2024-06-24 11:52:30 +08:00
'database' => getenv('DB_DATABASE',''),
2024-06-24 11:28:18 +08:00
// 数据库用户名
2024-06-24 11:52:30 +08:00
'username' => getenv('DB_USERNAME',''),
2024-06-24 11:28:18 +08:00
// 数据库密码
2024-06-24 11:52:30 +08:00
'password' => getenv('DB_PASSWORD',''),
2024-06-24 11:28:18 +08:00
// 数据库连接端口
2024-06-24 11:52:30 +08:00
'hostport' => getenv('DB_PORT','3306'),
2024-06-24 11:28:18 +08:00
// 数据库连接参数
'params' => [
// 连接超时3秒
\PDO::ATTR_TIMEOUT => 3,
],
// 数据库编码默认采用utf8
2024-06-24 11:52:30 +08:00
'charset' => 'utf8mb4',
2024-06-24 11:28:18 +08:00
// 数据库表前缀
'prefix' => '',
// 断线重连
'break_reconnect' => true,
// 关闭SQL监听日志
'trigger_sql' => false,
// 自定义分页类
2024-06-24 11:52:30 +08:00
'bootstrap' => '',
'auto_timestamp' => true
2024-06-24 11:28:18 +08:00
],
],
];