database.php 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. return [
  12. // 默认使用的数据库连接配置
  13. 'default' => env('database.driver', 'mysql'),
  14. // 自定义时间查询规则
  15. 'time_query_rule' => [],
  16. // 自动写入时间戳字段
  17. // true为自动识别类型 false关闭
  18. // 字符串则明确指定时间字段类型 支持 int timestamp datetime date
  19. 'auto_timestamp' => true,
  20. // 时间字段取出后的默认时间格式
  21. 'datetime_format' => 'Y-m-d H:i:s',
  22. // 数据库连接配置信息
  23. 'connections' => [
  24. 'mysql' => [
  25. // 数据库类型
  26. 'type' => env('database.type', 'mysql'),
  27. // 服务器地址
  28. 'hostname' => env('database.hostname', '127.0.0.1'),
  29. // 数据库名
  30. 'database' => env('database.database', 'crmeb_hdlkeji_co'),
  31. // 用户名
  32. 'username' => env('database.username', 'crmeb_hdlkeji_co'),
  33. // 密码
  34. 'password' => env('database.password', 'GE47TZBRFtJE4aMZ'),
  35. // 端口
  36. 'hostport' => env('database.hostport', '3306'),
  37. // 数据库连接参数
  38. 'params' => [],
  39. // 数据库编码默认采用utf8
  40. 'charset' => env('database.charset', 'utf8'),
  41. //'charset' => 'utf8mb4',
  42. // 数据库表前缀
  43. 'prefix' => env('database.prefix', 'eb_'),
  44. // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
  45. 'deploy' => 0,
  46. // 数据库读写是否分离 主从式有效
  47. 'rw_separate' => false,
  48. // 读写分离后 主服务器数量
  49. 'master_num' => 1,
  50. // 指定从服务器序号
  51. 'slave_no' => '',
  52. // 是否严格检查字段是否存在
  53. 'fields_strict' => true,
  54. // 是否需要断线重连
  55. 'break_reconnect' => true,
  56. // 监听SQL
  57. 'trigger_sql' => env('app_debug', true),
  58. // 开启字段缓存
  59. 'fields_cache' => false,
  60. // 字段缓存路径
  61. 'schema_cache_path' => app()->getRuntimePath() . 'schema' . DIRECTORY_SEPARATOR,
  62. ],
  63. // 更多的数据库配置信息
  64. ],
  65. ];