database.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. return array
  3. (
  4. # default database config
  5. 'default' => array
  6. (
  7. 'type' => 'pdo',
  8. 'host' => array
  9. (
  10. 'read' => 'localhost:3306',
  11. 'update' => 'localhost:3306',
  12. ),
  13. 'database' => 'dever',
  14. 'username' => 'root',
  15. 'password' => '123456',
  16. 'charset' => 'utf8',
  17. # 持久化服务器,只负责保存数据,跟读写分离差不多,但可以更换不同的数据库类型
  18. /*
  19. 'save' => array
  20. (
  21. 'type' => 'pdo',
  22. 'host' => 'localhost:3306',
  23. 'database' => 'dever_test',
  24. 'username' => 'root',
  25. 'password' => '123456',
  26. 'charset' => 'utf8',
  27. ),
  28. # 迁移旧的数据库服务器,具体迁移规则请到old目录中定义
  29. 'old' => array
  30. (
  31. 'type' => 'pdo',
  32. 'host' => 'localhost:3306',
  33. 'database' => 'mazephp',
  34. 'username' => 'root',
  35. 'password' => '123456',
  36. 'charset' => 'utf8',
  37. )
  38. */
  39. ),
  40. /*
  41. 'manage' => array
  42. (
  43. 'type' => 'mysql',
  44. 'host' => 'localhost:3306,localhost:3306',//read,update
  45. 'database' => 'dever',
  46. 'username' => 'root',
  47. 'password' => '123456',
  48. 'charset' => 'utf8'
  49. )
  50. array
  51. (
  52. 'type' => 'mongo',
  53. 'host' => '127.0.0.1:27017',
  54. 'database' => 'farm',
  55. ),
  56. */
  57. );