1
al_in_chicag
Error [Xoops]: Unable to connect to database in file class/database/databasefactory.php line 34

I had installed XOOPS on my website and everything was running smoothly. I was in the news section submitting a news article and upon hitting "submit", I get the following message "Error [Xoops]: Unable to connect to database in file class/database/databasefactory.php line 34"

i cannot get back into my administration menu. Please advise on what to do.

sincerely,

Alfonso

2
Eugney
Re: Error [Xoops]: Unable to connect to database in file class/database/databasefactory.php line 34
  • 2004/12/14 5:16

  • Eugney

  • Not too shy to talk

  • Posts: 162

  • Since: 2004/7/25


If you can't get to the administration page, but have access to mysql, try the query "UPDATE xoops_config SET conf_value=1 WHERE conf_name = 'debug_mode'". Be sure to make sure "xoops_config" matches the name of the config table in your installation.

2. If you can't get to the administration page, and don't want to mess with mysql, but don't mind messing with PHP, then edit the file "include/common.php". Near line 83, change "error_reporting(0);" to "error_reporting(E_ALL);".

3. If this still doesn't work, your server or hoster may have turned off debugging in "/etc/php.ini" (linux) or "WIN_DIRECTORY/php.ini" (windows). Make sure there is a line in there "display_errors On".

4. If you don't have access to change this file (e.g. on shared hosting), then if the server uses the "apache" webserver, you can create a file called ".htaccess" to override the settings locally. This file should contain the line: "php_flag display_errors on". The tricky part is WHERE to put this file. Look at the URL you are having problems with. Put the file in the corresponding directory. e.g. If it is "someplace.com/xoops/" or "someplace.com/xoops/index.php" then you need to put the file in the main XOOPS directory. If it is something like "someplace.com/xoops/modules/system/admin.php" then put it in "modules/system" subdirectory of your XOOPS installation. etc.

3
Mithrandir
Re: Error [Xoops]: Unable to connect to database in file class/database/databasefactory.php line 34

Eugney - what has that got to do with anything? Alfonso DOES get the error displayed on the page.

Alfonso - the problem is that the database is suddenly not available anymore due to something or someone.
As the XOOPS FAQ suggests, see if you can contact the database through your administration tools (CPanel, PHPMyAdmin or similar) and contact your hosting service to learn if they have changed anything for your account.

4
Eugney
Re: Error [Xoops]: Unable to connect to database in file class/database/databasefactory.php line 34
  • 2004/12/14 7:15

  • Eugney

  • Not too shy to talk

  • Posts: 162

  • Since: 2004/7/25


lol I dont know I was just posting the truoble shoter when I saw cant get to admin panel lol sorry

5
al_in_chicag
Re: Error [Xoops]: Unable to connect to database in file class/database/databasefactory.php line 34

hello guys.

I have sent an email to my hosting company asking them what is going on with my hosting account. I did absolutely nothing and I typed up the page today and I was able to get the site back! After working on the site for 2 hours, the same happens. I get the same error message I had posted. This is driving me nuts!!!! Thanks for your help and suggestions.

Alfonso

6
shivaji
Re: Error [Xoops]: Unable to connect to database in file class/database/databasefactory.php line 34
  • 2004/12/15 6:25

  • shivaji

  • Friend of XOOPS

  • Posts: 179

  • Since: 2003/9/18


Mithrandir,

I am not sure but there is something more into it, which generate this errors. I posted a similar topics before What is there in line 34 of databasefactory.php ?. Our website is hosted with RackSpace server and system admin reported me that it happened due to some MySQL query which is not working properly in some cases. I hope this will be fine, if i put a excerpt from his comment for better understanding:


"Now I think we've known ever since we moved this site to the new server that there is a big problem with server load - and that the load problem is caused by MySql - RackSpace told us that very early on.

This server has recorded the highest load I have ever seen -over 200 one minute load average - and has a history of becoming unresponsive and requiring a reboot - all due to MySql problems. When I entered the data from the other server it took over 5 hours to read the data file into MySql - and this is only a 750MB database which is NOT that large and should NOT be this kind of problem. I've looked at some of the queries that are running and they are neither outrageous nor are there so many to explain the kind of problems we are seeing. But problems with the database design and missing or invalid indexes ARE enough to cause the problems we've been seeing.

I know the site has been undergoing a redesign, and until you tell me this is done I won't be logging in or doing any work on it. I don't know if part of that redesign has been a redesign of the database table structure - but if not, then this is sorely needed - this server will not stay running until this is fixed."

-Shivaji.

7
JMorris
Re: Error [Xoops]: Unable to connect to database in file class/database/databasefactory.php line 34
  • 2004/12/15 6:37

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Devs, is it outside the relm of reason that XOOPS may have some database handling issues? Not trying to stir anything, just looking for some enlightenment.

Richard and I both have reported database issues that are exclusive to XOOPS and there seems to be a rash of posts as of late posting similar issues. Also, I've notice site performance on every 2.0.7.3 site I've visited is not as responsive as prior versions. Just seems slower [note: I'm on 3Mbps Cable, it isn't my connection]

I'll make no bones about it, I don't know diddly squat when it comes to MySQL, but I do know 1+1=2. Seems these issues are not isolated and deserve some attention.

Please understand, I know you will do what you can where you can and I don't expect results yesterday. I'm just merely suggesting that the way XOOPS handles database queries be looked at. That's all.

Thanks.

P.S. Sorry for the thread hijack.

8
Mithrandir
Re: Error [Xoops]: Unable to connect to database in file class/database/databasefactory.php line 34

Quote:
Devs, is it outside the realm of reason that XOOPS may have some database handling issues?
Of course not - it may very well be, but I don't know what you want from us.

Quote:
I've notice site performance on every 2.0.7.3 site I've visited is not as responsive as prior versions
What constitutes "prior versions"?

When the system admin at RackSpace says Quote:
I've looked at some of the queries that are running and they are neither outrageous nor are there so many to explain the kind of problems we are seeing
It is hard to know where to look, however with this:
Quote:
problems with the database design and missing or invalid indexes ARE enough to cause the problems we've been seeing

We have something to go by - but my expertise is too small to know what constitutes an invalid index.


Again, I don't know what you want from us - I don't personally have high-traffic, troublesome sites. We have xoops.org that occasionally has the problem with connecting to the database, but not enough to be able to troubleshoot it.

Feel free to do some research yourself, though.

9
JMorris
Re: Error [Xoops]: Unable to connect to database in file class/database/databasefactory.php line 34
  • 2004/12/15 15:29

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Quote:
Of course not - it may very well be, but I don't know what you want from us.


If I knew where to start, I would have submitted an offering with my post, but unfortunately, I'm a complete MySQL n00b. I was hoping that the Devs were aware of issues and could offer a "We are working on it", but I guess this is going to be something where we all do our homework to find the problem.

Quote:
What constitutes "prior versions"?


I will setup some older versions for test purposes and see if I can get some hard numbers for you. It's not out the relm of reason that it could be my perception, but to me, there seems to be a slight performance lag with 2.0.7.3. Just for the sake of proper reporting, I will test my theory and get back with you with some facts.

Quote:
I don't personally have high-traffic, troublesome sites.


My sites are doing good to get 500 unique visits a day and, to me, there seems to be a difference. Again, I will research this further.

EDIT:
Quote:
We have xoops.org that occasionally has the problem with connecting to the database, but not enough to be able to troubleshoot it.


Occasionally might be a mild understatement. It's happened to me every day this week while browsing this site.
This page cannot be displayed due to an internal error.

If 
you are the administrator of this siteplease visit the XOOPS Troubleshooting Page for assistance.

Error [Xoops]: Unable to connect to database in file class/database/databasefactory.php line 34


I realize there have been some issues with site duplicators, Spammers, trolls and whatnot, but the frequency of these errors has increased as of late.

10
RVirtue
Re: Error [Xoops]: Unable to connect to database in file class/database/databasefactory.php line 34
  • 2004/12/15 16:54

  • RVirtue

  • Quite a regular

  • Posts: 246

  • Since: 2004/8/4 9


Hi. I'm adding my "two cents" here at James' request, but I'm not sure I can be very helpful in pinning anything down.

I too have seen here the error noted in this thread's title. It has caused me to lose my "inputs" often enough, in fact, that I'm now more careful than ever to prepare and save messages and replies off line prior to any posting attempt. However, I would also have to say that any relationship to other issues, such as those involved in our Netquery development work, is tenouous and unproven.

In developing the Netquery module, we ran into several problems that appear to have been involved simultaneously and, at the time, I was much more concerned about eliminating the difficulties than I was about causal relationships. Thus it is difficult to attribute specific aspects of those problems to a particular cause. The best I can do is to list some factors:

1) The XOOPS module installer appears to have some difficulties with handling some phpMyAdmin exports, especially large ones. Version specificity may be involved as with, for example, the recent change in phpMyAdmin's comment character.

2) It appears that some hosting service providers (my 1and1.com "business package" host for sure) are imposing their own "unadvertised" restrictions on SQL queries. Even their senior support staff may be unaware of these restrictions which, in the case I now know about, limited data inserts to about 2000 records each.

3) Host configuration settings for both PHP and MySQL can also be involved and may or may not be capable of being overridden by individual accounts with either .htaccess or php.ini local settings. PHP script timeout is mentioned briefly in "carnuke's" excellent FAQ, but there are others as well that can be significant for data handling ops.

That's about as much as I can say with any certainty about the situations I have encountered myself. Hope it helps to at least open some routes for further exploration.

Login

Who's Online

289 user(s) are online (230 user(s) are browsing Support Forums)


Members: 0


Guests: 289


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits