This commit is contained in:
彭桃 2023-01-29 09:17:31 +08:00
parent 12289d5cb6
commit defb92c12a

View File

@ -1,4 +1,6 @@
<?php
use think\facade\Env;
return [
// 默认使用的数据库连接配置
'default' => 'mysql',
@ -14,23 +16,23 @@ return [
'connections' => [
'mysql' => [
// 数据库类型
'type' => 'mysql',
'type' => Env::get('database.type', 'mysql'),
// 服务器地址
'hostname' => '127.0.0.1',
'hostname' => Env::get('database.hostname', '127.0.0.1'),
// 数据库名
'database' => 'gougucms',
'database' => Env::get('database.database', ''),
// 用户名
'username' => 'root',
'username' => Env::get('database.username', 'root'),
// 密码
'password' => '123456',
'password' => Env::get('database.password', ''),
// 端口
'hostport' => '3306',
'hostport' => Env::get('database.hostport', '3306'),
// 数据库表前缀
'prefix' => 'cms_',
'prefix' => Env::get('database.prefix', ''),
// 数据库连接参数
'params' => [],
// 数据库编码默认采用utf8mb4
'charset' => 'utf8mb4',
'charset' => Env::get('database.charset', 'utf8'),
// 数据库调试模式
'debug' => false,
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
@ -50,5 +52,25 @@ return [
// 开启字段缓存
'fields_cache' => false,
],
'shop' => [
// 数据库类型
'type' => Env::get('databaseshop.type', 'mysql'),
// 服务器地址
'hostname' => Env::get('databaseshop.hostname', '127.0.0.1'),
// 数据库名
'database' => Env::get('databaseshop.database', ''),
// 用户名
'username' => Env::get('databaseshop.username', 'root'),
// 密码
'password' => Env::get('databaseshop.password', ''),
// 端口
'hostport' => Env::get('databaseshop.hostport', '3306'),
// 数据库连接参数
'params' => [],
// 数据库编码默认采用utf8
'charset' => Env::get('databaseshop.charset', 'utf8'),
// 数据库表前缀
'prefix' => Env::get('databaseshop.prefix', ''),
],
],
];