database.php 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkAdmin
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2014~2022 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: https://thinkadmin.top
  8. // +----------------------------------------------------------------------
  9. // | 开源协议 ( https://mit-license.org )
  10. // | 免费声明 ( https://thinkadmin.top/disclaimer )
  11. // +----------------------------------------------------------------------
  12. // | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
  13. // | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
  14. // +----------------------------------------------------------------------
  15. return [
  16. // 默认使用的数据库连接配置
  17. 'default' => 'mysql',
  18. // 自定义时间查询规则
  19. 'time_query_rule' => [],
  20. // 自动写入时间戳字段
  21. 'auto_timestamp' => true,
  22. // 时间字段取出后的默认时间格式
  23. 'datetime_format' => 'Y-m-d H:i:s',
  24. // 数据库连接配置信息
  25. 'connections' => [
  26. 'mysql' => [
  27. // 数据库类型
  28. 'type' => 'mysql',
  29. // 服务器地址
  30. // 'hostname' => '120.79.86.50',
  31. 'hostname' => '182.40.104.187',
  32. // 数据库名
  33. // 'database' => 'ship_expert',
  34. 'database' => 'ship_expert',
  35. // 用户名
  36. // 'username' => 'ship_expert',
  37. 'username' => 'ship_expert',
  38. // 密码
  39. // 'password' => 'zhousi123',
  40. 'password' => '2MAYtib83XfzYRPK',
  41. // 端口
  42. 'hostport' => '3306',
  43. // 数据库连接参数
  44. 'params' => [],
  45. // 数据库编码默认采用 utf8
  46. 'charset' => 'utf8mb4',
  47. // 数据库表前缀
  48. 'prefix' => '',
  49. // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
  50. 'deploy' => 0,
  51. // 数据库读写是否分离 主从式有效
  52. 'rw_separate' => false,
  53. // 读写分离后 主服务器数量
  54. 'master_num' => 1,
  55. // 指定从服务器序号
  56. 'slave_no' => '',
  57. // 是否严格检查字段是否存在
  58. 'fields_strict' => true,
  59. //数据集返回类型
  60. 'resultset_type' => 'collection',
  61. // 是否需要断线重连
  62. 'break_reconnect' => false,
  63. // 监听SQL执行日志
  64. 'trigger_sql' => true,
  65. // 开启字段类型缓存
  66. 'fields_cache' => !app()->isDebug(),
  67. ],
  68. ],
  69. ];