database.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. return
  3. array (
  4. 'default' => 'mysql',
  5. 'time_query_rule' =>
  6. array (
  7. ),
  8. 'auto_timestamp' => true,
  9. 'datetime_format' => 'Y-m-d H:i:s',
  10. 'connections' =>
  11. array (
  12. 'mysql' =>
  13. array (
  14. 'type' =>env("database.type","mysql"),
  15. 'hostname' => env("database.hostname","127.0.0.1"),
  16. 'database' => env("database.database","lemocms"),
  17. 'username' => env("database.username","root"),
  18. 'password' => env("database.password","root"),
  19. 'hostport' =>env("database.hostport","3306"),
  20. 'params' =>
  21. array (
  22. ),
  23. 'charset' => env("database.charset","utf8mb4"),
  24. 'prefix' =>env("database.prefix","lm_"),
  25. 'debug' => env("database.debug",true),
  26. 'deploy' => 0,/// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
  27. 'rw_separate' => false, // 数据库读写是否分离 主从式有效
  28. 'resultset_type'=>"collection",
  29. // 开启自动主库读取
  30. 'read_master' => false,
  31. 'master_num' => 1,// 读写分离后 主服务器数量
  32. 'slave_no' => '',//// 指定从服务器序号
  33. // 监听SQL
  34. 'trigger_sql' => true,
  35. // 开启字段缓存
  36. 'fields_cache' => false,
  37. 'fields_strict' => true,
  38. 'break_reconnect' => false,
  39. 'schema_cache_path' => '..\\runtime\\schema\\',
  40. // 字段缓存路径
  41. // 'schema_cache_path' => app()->getRuntimePath() . 'schema' . DIRECTORY_SEPARATOR,
  42. ),
  43. ),
  44. )
  45. ;