database.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: liu21st <liu21st@gmail.com>
  10. // +----------------------------------------------------------------------
  11. return [
  12. // 数据库类型
  13. 'type' => 'mysql',
  14. // 服务器地址
  15. //'hostname' => 'st.titanera.com',
  16. //'hostname' => '192.168.5.104',
  17. 'hostname' => '192.168.5.110',
  18. // 'hostname' => '',
  19. // 数据库名
  20. //'database' => 'monk_live',
  21. 'database' => 'mt4r111',
  22. //'database' => 'view',
  23. // 用户名
  24. //'username' => 'root',
  25. 'username' => 'elmo',
  26. //'username' => 'root',
  27. // 密码
  28. //'password' => 'abc123',
  29. 'password' => 'Elmo@666',
  30. //'password' => 'root',
  31. // 端口
  32. 'hostport' => '',
  33. // 连接dsn
  34. 'dsn' => '',
  35. // 数据库连接参数
  36. 'params' => [],
  37. // 数据库编码默认采用utf8
  38. 'charset' => 'utf8',
  39. // 数据库表前缀
  40. 'prefix' => '',
  41. // 数据库调试模式
  42. 'debug' => true,
  43. // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
  44. 'deploy' => 0,
  45. // 数据库读写是否分离 主从式有效
  46. 'rw_separate' => false,
  47. // 读写分离后 主服务器数量
  48. 'master_num' => 1,
  49. // 指定从服务器序号
  50. 'slave_no' => '',
  51. // 自动读取主库数据
  52. 'read_master' => false,
  53. // 是否严格检查字段是否存在
  54. 'fields_strict' => true,
  55. // 数据集返回类型
  56. 'resultset_type' => 'array',
  57. // 自动写入时间戳字段
  58. 'auto_timestamp' => false,
  59. // 时间字段取出后的默认时间格式
  60. 'datetime_format' => 'Y-m-d H:i:s',
  61. // 是否需要进行SQL性能分析
  62. 'sql_explain' => false,
  63. ];