database.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Think.Admin
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2014~2017 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: http://think.ctolog.com
  8. // +----------------------------------------------------------------------
  9. // | 开源协议 ( https://mit-license.org )
  10. // +----------------------------------------------------------------------
  11. // | github开源项目:https://github.com/zoujingli/Think.Admin
  12. // +----------------------------------------------------------------------
  13. return [
  14. // 数据库类型
  15. 'type' => 'mysql',
  16. // 服务器地址
  17. 'hostname' => '127.0.0.1',
  18. // 数据库名
  19. 'database' => 'think.admin',
  20. // 用户名
  21. 'username' => 'think.admin',
  22. // 密码
  23. 'password' => 'think.admin',
  24. // 端口
  25. 'hostport' => '3306',
  26. // 连接dsn
  27. 'dsn' => '',
  28. // 数据库连接参数
  29. 'params' => [],
  30. // 数据库编码默认采用utf8
  31. 'charset' => 'utf8',
  32. // 数据库表前缀
  33. 'prefix' => '',
  34. // 数据库调试模式
  35. 'debug' => true,
  36. // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
  37. 'deploy' => 0,
  38. // 数据库读写是否分离 主从式有效
  39. 'rw_separate' => false,
  40. // 读写分离后 主服务器数量
  41. 'master_num' => 1,
  42. // 指定从服务器序号
  43. 'slave_no' => '',
  44. // 是否严格检查字段是否存在
  45. 'fields_strict' => true,
  46. // 数据集返回类型
  47. 'resultset_type' => 'array',
  48. // 自动写入时间戳字段
  49. 'auto_timestamp' => false,
  50. // 时间字段取出后的默认时间格式
  51. 'datetime_format' => 'Y-m-d H:i:s',
  52. // 是否需要进行SQL性能分析
  53. 'sql_explain' => false,
  54. // Builder类
  55. 'builder' => '',
  56. // Query类
  57. 'query' => '\\think\\db\\Query',
  58. ];