database.php 1.2 KB

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