Author Topic: Failed to connect to database  (Read 3215 times)

richardgush

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Failed to connect to database
« on: January 21, 2010, 05:49:03 am »
Please could some one help me with this error?

Error params:
File:    C:\Domains\avanty.org\wwwroot\environment\library\database\adapters\MysqlDBAdapter.class.php
Line:    32
Backtrace:
#0 C:\Domains\avanty.org\wwwroot\environment\library\database\adapters\AbstractDBAdapter.class.php(40): MysqlDBAdapter->connect(Array)
#1 C:\Domains\avanty.org\wwwroot\environment\library\database\DB.class.php(97): AbstractDBAdapter->__construct(Array)
#2 C:\Domains\avanty.org\wwwroot\environment\library\database\DB.class.php(64): DB::connectAdapter('mysql', Array)
#3 C:\Domains\avanty.org\wwwroot\init.php(117): DB::connect('mysql', Array)
#4 C:\Domains\avanty.org\wwwroot\index.php(9): require('C:\Domains\avan...')
#5 {main}
Autoglobal varibles:
$_GET:    Array (
  ['c'] => (string) 'access'
  ['a'] => (string) 'index'
)
$_POST:    
$_COOKIE:    Array (
  ['__utma'] => (string) '85421385.1199305999.1249132203.1255680426.1263810085.25'
  ['__utmz'] => (string) '85421385.1263810085.25.2.utmccn=(organic)|utmcsr=google|utmctr=avanty|utmcmd=organic'
  ['PHPSESSID'] => (string) '5ru4b9gvjupese1v2m434eiun7'
  ['id'] => (string) '1'
  ['token'] => (string) '39cb6addb977f55628b9d1b5055889113448a4e9'
  ['remember'] => (string) '1'
)
$_SESSION:    Array (
  ['year'] => (string) '2010'
  ['month'] => (string) '1'
  ['day'] => (string) '20'
  ['flash_data'] => Array (
  )
)
Execution time:
Total execution time: 0.015700 seconds


Regards
Richard

maathieu

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: [1.6.2] Failed to connect to database
« Reply #1 on: March 09, 2010, 07:47:10 am »
Same problem here (with Feng Office Community Edition v1.6.2 on Linux). This message seems to pop up at random (sometimes it shows up, sometimes it doesn't).

Maybe this has something to do with shared hosting, but how do we know?
« Last Edit: March 09, 2010, 07:48:52 am by maathieu »

maathieu

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: [1.6.2] Failed to connect to database
« Reply #2 on: March 09, 2010, 08:18:35 am »
OK, I found an answer!

Try to desactivate persistent DB connections (in config/config.php set    DB_PERSIST to false).

It solved the problem for me: seems that Feng Office does not close connections correctly (it may also be a server configuration issue), so after a while I end up with too many connections open and FO does not want to open new ones.

Cheers,

mathieu
« Last Edit: March 10, 2010, 06:50:08 am by maathieu »