2014-03-27 31 views
0

我試圖用symfony2連接到兩個mongodb數據庫,當我嘗試一個數據庫時它工作正常,但有兩個我有一個錯誤,這裏是我的config.yml文件:從配置文件中爲symfony2選擇mongodb數據庫

doctrine_mongodb: 
connections: 
    statistiques: 
     server: mongodb://user:[email protected]:27017/statistiques 
     options: 
      db: statistiques 

    archive_prod: 
     server: mongodb://user:[email protected]:27017/archive_prod 
     options: 
      db: archive_prod 

document_managers: 
    statistiques: 
     auto_mapping: true 
     connection: statistiques 

    archive_prod: 
     auto_mapping: true 
     connection: archive_prod 

在錯誤我有這樣的: 無法連接到:本地主機:27017:驗證失敗數據庫「默認」使用用戶名「用戶」:身份驗證失敗

即使我沒有任何選擇名稱爲'default'的數據庫 我可以使用default_database設置默認數據庫:statistiques ,但是我需要用兩個數據庫

回答