PDA

View Full Version : Database error persistant since 3 years! Please help


ehabfouad22
11-03-2010, 03:20 PM
Hi,
I have a frequent database error on my board.
I changed my host about a year ago to upgrade the php version which I thought it was the reason of this error, I contacted the current host so many times for this, I'm trying myself to optimize and repair my tables, and the server goes away every time I try this, I've failed to learn how to deal with mysql and ssh tools, and failed also to get benefit of the related posts here in vBulletin.org!
I'm ready to do whatever I have to for having a professional maintenance for my database, cause I'm totally desperate of doing this myself by using the available tools and references here in vBulletin :(
Any kind of help?

Boofo
11-03-2010, 06:37 PM
What is the db error?

Lynne
11-03-2010, 10:01 PM
If your error is a MySQL has gone away error, do you have your own server? Because if you don't have access to change server variables, then the only thing you can do is complain to the host.

ehabfouad22
11-04-2010, 12:17 AM
What is the db error?

hi,
The error experienced on loading forum pages is: The database has encountered a problem.
Please try the following:

* Load the page again by clicking the Refresh button in your web browser.
Etc..

While fixing the issue via phpMyAdmin, the most common error I get is (The server cannot be found), i.e the page that appears when you have no internet connection.

Sometimes on optimizing or repairing (post) table in particular, an error appears (the server has gone away, no pma_comment is found on this database) and the error number is #2006.
Thanks, Boofo! :)

--------------- Added 1288833955 at 1288833955 ---------------

If your error is a MySQL has gone away error, do you have your own server? Because if you don't have access to change server variables, then the only thing you can do is complain to the host.

Hi,
I have a web host. Not a server of my own. I did contact the host so many times for that, and the most recent reply I got was the following:
"Dear Ehab,
I am sorry to hear that you were experiencing issues with issues on your site. Although I unable to directly replicate any errors, I have scanned your site through the malware scanner and verified that the site is clean of any malware. I have also updated the custom php.ini file to your hosting package and configured your site to create its sessions on your hosting package?s my_root/tmp folder to allow it process your database queries more efficiently. "

The forum was working properly for few days after I received this message, and then I started to get the same database error once again.
Sorry for the long reply, and thanks in advance, Lynne :)

Lynne
11-04-2010, 01:57 AM
When you get the database error, view the page source for that page and you will see the actual database error near the bottom of that page. It will have some information like this:
The actual mysql query/code/problem....

MySQL Error : some sort of something here
Error Number : another something here
Date : Sunday, April 13th 2008 @ 11:16:43 AM
Script : http://address.path.path/page.php
Referrer :
IP Address : **.***.**.***
Username : username
Classname : database

That is the database error we need to see.

ehabfouad22
11-04-2010, 03:57 PM
When you get the database error, view the page source for that page and you will see the actual database error near the bottom of that page. It will have some information like this:
The actual mysql query/code/problem....

MySQL Error : some sort of something here
Error Number : another something here
Date : Sunday, April 13th 2008 @ 11:16:43 AM
Script : http://address.path.path/page.php
Referrer :
IP Address : **.***.**.***
Username : username
Classname : database

That is the database error we need to see.


Hi,
This is not the type of errors I meant. The error page you describe, with an internal window in it, was happening a long time ago on my board, and disappeared right after transfering host, and upgrading the php version from 4 to 5.

The error I'm currently experiencing reads as I described:
"The database has encountered a problem.
Please try the following:

* Load the page again by clicking the Refresh button in your web browser.
* contact the administrator of www.mysite.com
* Try to refresh the page.......etc."
without any additional infromation near the bottom of the error page, such as the table name, the I.P, etc.
I hope I made myself more clear.
Thanks Lynne!

Boofo
11-04-2010, 04:08 PM
You will have to view the source of the page to see the error then.

ehabfouad22
11-04-2010, 04:42 PM
The error appears when I try to load the forum home page, and in other instances the homepage loads correctly, but the threads and subforums is showing the same error.
The text of the only error I get is exactly as follows:

"Database error
The database has encountered a problem.

--------------------------------------------------------------------------------

Please try the following:
Load the page again by clicking the Refresh button in your web browser.
Open the www.mysite.org home page, then try to open another page.
Click the Back button to try another link.

The www.mysite.org forum technical staff have been notified of the error, though you may contact them if the problem persists.

We apologise for any inconvenience."

And I apologize also for any inconvenience :) But I'm really fed up with that frequent error that may last for hours.
Thanks for your time, guys, and as I said I hope I can find an actual professional reliable solution to make my database tables work more effeciently.

Lynne
11-04-2010, 05:20 PM
When you get the page that says:
"Database error
The database has encountered a problem.

etc..."

Then view the page source and you will see what the actual error is. Follow my instructions in post 5.

ehabfouad22
11-04-2010, 10:11 PM
When you get the page that says:
"Database error
The database has encountered a problem.

etc..."

Then view the page source and you will see what the actual error is. Follow my instructions in post 5.

Hi Lynne,
I apologise for not understanding.
Here's the code I got:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title> Database Error</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="ROBOTS" content="NOINDEX,NOFOLLOW,NOARCHIVE" />
<style type="text/css">
<!--
body { background-color: white; color: black; }
#container { width: 400px; }
#message { width: 400px; color: black; background-color: #FFFFCC; }
#bodytitle { font: 13pt/15pt verdana, arial, sans-serif; height: 35px; vertical-align: top; }
.bodytext { font: 8pt/11pt verdana, arial, sans-serif; }
a:link { font: 8pt/11pt verdana, arial, sans-serif; color: red; }
a:visited { font: 8pt/11pt verdana, arial, sans-serif; color: #4e4e4e; }
-->
</style>
</head>
<body>
<table cellpadding="3" cellspacing="5" id="container">
<tr>

<td><img src="./image.php?type=dberror" alt="Database Error" width="48" height="48" /></td>
<td id="bodytitle" width="100%">Database error</td>
</tr>
<tr>
<td class="bodytext" colspan="2">The database has encountered a problem.</td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
<tr>
<td class="bodytext" colspan="2">

Please try the following:
<ul>
<li>Load the page again by clicking the <a href="#" onclick="window.location = window.location;">Refresh</a> button in your web browser.</li>
<li>Open the <a href="/">mysite.org</a> home page, then try to open another page.</li>
<li>Click the <a href="javascript:history.back(1)">Back</a> button to try another link.</li>

</ul>
</td>
</tr>
<tr>
<td class="bodytext" colspan="2">The mysite.org forum technical staff have been notified of the error, though you may <a href="mailto:webmaster@mysite.org">contact them</a> if the problem persists.</td>
</tr>
<tr>
<td class="bodytext" colspan="2">&nbsp;<br />We apologise for any inconvenience.</td>

</tr>

<!--
Database error in vBulletin :

mysql_connect() [&lt;a href='function.mysql-connect'&gt;function.mysql-connect&lt;/a&gt;]: User [my_database_name] already has more than 'max_user_connections' active connections
/data/22/2/48/150/2048476/user/2244090/htdocs/vb/includes/class_core.php on line 311

MySQL Error :
Error Number :
Request Date : Thursday, November 4th 2010 @ 07:01:24 PM
Error Date : Thursday, November 4th 2010 @ 07:01:24 PM
Script : http://mysite.org/vb/
Referrer :
IP Address : my_IP***.138
Username :
Classname : vB_Database
MySQL Version :
-->

Thanks for your time, Lynne!
Regards

Lynne
11-04-2010, 10:21 PM
This error:
User [my_database_name] already has more than 'max_user_connections' active connections
is a server error and if you don't tell your host exactly what error you are getting, then they aren't going to know how to fix this one. It can show up intermittently and so they may never see it. If you've never given the host the exact error, then it's really no wonder that they have never fixed it for you.

The server has maxed out the number of MySQL connections it allows. You can try turning persistent connections off by adding this to your config.php:
$config['MasterServer']['usepconnect'] = 0; But, if you still have the problem you will have to talk to your host about raising that limit. Also, see this Common MySQL Error Messages (http://www.vbulletin.com/docs/html/troubleshoot_mysql_errors)

ehabfouad22
11-06-2010, 02:59 PM
This error:
User [my_database_name] already has more than 'max_user_connections' active connections
is a server error and if you don't tell your host exactly what error you are getting, then they aren't going to know how to fix this one. It can show up intermittently and so they may never see it. If you've never given the host the exact error, then it's really no wonder that they have never fixed it for you.

The server has maxed out the number of MySQL connections it allows. You can try turning persistent connections off by adding this to your config.php:
$config['MasterServer']['usepconnect'] = 0; But, if you still have the problem you will have to talk to your host about raising that limit. Also, see this Common MySQL Error Messages (http://www.vbulletin.com/docs/html/troubleshoot_mysql_errors)

Thank you very much, Lynne! I appreciate it.
The code you provided ($config['MasterServer']['usepconnect'] = 0 ) is already there in my config.php
Can I raise the limit myself? or should I contact the host for raising it. Is there any recommended value of that limit?
Many thanks, guys! That was really helpful :)

Paul M
11-06-2010, 03:27 PM
No, you cannot raise it yourself. Contact your host.

ehabfouad22
11-07-2010, 03:35 PM
No, you cannot raise it yourself. Contact your host.

Thank you Paul,
I got this reply from my host:
"Dear Ehab,

I am sorry you are having issues with your website. The reason you are experiencing this error is because the limit of mysql connections is 10. There is no way to increase this limit, but the error is most likely caused by your connections not being closed. Ensure that your websites code is closing the database connections immediately after use. This will decrease the chance of this error occurring"

Now do you see that the value (10) is so low that it may cause this frequent error? If so, I would change my host to another one which provides a higher limit.
If you see that the value is sufficient, I would be grateful if you give me information on how to make sure that the forum codes is closing the database connections immediately after use.
Thanks in advance! :)
Ehab

Lynne
11-07-2010, 04:25 PM
10?!?! Wow. I have heard of some hosts keeping it as low as 25, but never 10. Yes, that is low.

Try disabling your mods for a few days and see if you still have the same problem.

ehabfouad22
11-07-2010, 10:55 PM
10?!?! Wow. I have heard of some hosts keeping it as low as 25, but never 10. Yes, that is low.

Try disabling your mods for a few days and see if you still have the same problem.

Thank you, Lynne..
I've disabled the Chatbox mod for now, and I'm upgrading to a VPS hosting soon. I've been suffering for so long from the shared packages, and I think it's time to seek a little peace of mind. I hope this would be a solution.
Thanks a lot for your time, guys.
Sincerely, Ehab

Gamelobby
11-08-2010, 04:54 PM
I have similar issues randomly once or twice a month.
I will keep an eye out for the source code next time it happens. :)



Thank you Paul,
I got this reply from my host:
"Dear Ehab,

I am sorry you are having issues with your website. The reason you are experiencing this error is because the limit of mysql connections is 10. There is no way to increase this limit, but the error is most likely caused by your connections not being closed. Ensure that your websites code is closing the database connections immediately after use. This will decrease the chance of this error occurring"

Now do you see that the value (10) is so low that it may cause this frequent error? If so, I would change my host to another one which provides a higher limit.
If you see that the value is sufficient, I would be grateful if you give me information on how to make sure that the forum codes is closing the database connections immediately after use.Thanks in advance! :)
Ehab
That would be GREAT information.!!




10?!?! Wow. I have heard of some hosts keeping it as low as 25, but never 10. Yes, that is low.

Try disabling your mods for a few days and see if you still have the same problem.
Which host only gives you 10.?




Thanks

--------------- Added 1289246952 at 1289246952 ---------------

I got the error again.. here is what it said.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title> Database Error</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="ROBOTS" content="NOINDEX,NOFOLLOW,NOARCHIVE" />
<style type="text/css">
<!--
body { background-color: white; color: black; }
#container { width: 400px; }
#message { width: 400px; color: black; background-color: #FFFFCC; }
#bodytitle { font: 13pt/15pt verdana, arial, sans-serif; height: 35px; vertical-align: top; }
.bodytext { font: 8pt/11pt verdana, arial, sans-serif; }
a:link { font: 8pt/11pt verdana, arial, sans-serif; color: red; }
a:visited { font: 8pt/11pt verdana, arial, sans-serif; color: #4e4e4e; }
-->
</style>
</head>
<body>
<table cellpadding="3" cellspacing="5" id="container">
<tr>
<td><img src="./image.php?type=dberror" alt="Database Error" width="48" height="48" /></td>
<td id="bodytitle" width="100%">Database error</td>
</tr>
<tr>
<td class="bodytext" colspan="2">The database has encountered a problem.</td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
<tr>
<td class="bodytext" colspan="2">
Please try the following:
<ul>
<li>Load the page again by clicking the <a href="#" onclick="window.location = window.location;">Refresh</a> button in your web browser.</li>
<li>Open the <a href="/">www.gamelobby.com</a> home page, then try to open another page.</li>
<li>Click the <a href="javascript:history.back(1)">Back</a> button to try another link.</li>
</ul>
</td>
</tr>
<tr>
<td class="bodytext" colspan="2">The www.gamelobby.com forum technical staff have been notified of the error, though you may <a href="mailto:Info@Gamelobby.com">contact them</a> if the problem persists.</td>
</tr>
<tr>
<td class="bodytext" colspan="2">&nbsp;<br />We apologise for any inconvenience.</td>
</tr>
</table>


<!--
Database error in vBulletin :

mysql_connect() [&lt;a href='function.mysql-connect'&gt;function.mysql-connect&lt;/a&gt;]: Too many connections
/home/content/m/i/l/milo327/html/Forum/includes/class_core.php on line 311

MySQL Error :
Error Number :
Request Date : Monday, November 8th 2010 @ 01:05:46 PM
Error Date : Monday, November 8th 2010 @ 01:05:46 PM
Script : http://www.gamelobby.com/Forum/cmps_index
Referrer : http://www.gamelobby.com/
IP Address : 108.13.48.18
Username :
Classname : vB_Database
MySQL Version :
-->


</body>
</html>


--------------- Added 1289254025 at 1289254025 ---------------

latest error code..


mysql_connect() [&lt;a href='function.mysql-connect'&gt;function.mysql-connect&lt;/a&gt;]: Too many connections
/home/content/m/i/l/milo327/html/Forum/includes/class_core.php on line 311

ehabfouad22
11-18-2010, 05:29 PM
Which host only gives you 10.?



Network Solutions.

thespi
12-03-2010, 08:08 AM
Heres one I get:
Database error in vBulletin 4.1.0:

Invalid SQL:
SELECT cache.originaltext as originaltext, cache.translated as translated FROM vbenterprisetranslator_cache_medium help, vbenterprisetranslator_cache_medium cache WHERE help.originaltext='by+Aristotle+%0Ahttp%3A%2F%2Fww w.carpediem.im%2Fattachment.php%3Fattachmentid%3D4 9+%0ATranslation+by+W.+D.+Ross+%0A+%0ABook+I+%0ABo ok+II+%0ABook+III+%0ABook+IV+%0ABook+V+%0ABook+VI' AND help.tl='pt' AND cache.serie=help.serie;

MySQL Error : MySQL server has gone away
Error Number : 2006
Request Date : Thursday, December 2nd 2010 @ 04:09:16 PM
Error Date : Thursday, December 2nd 2010 @ 04:11:59 PM
Script : http://www.carpediem.im/pt/showthread.php/1237-Nicomachean-Ethics-by-Aristotle?p=1664&viewfull=1
Referrer :
IP Address : 119.63.198.95
Username : Unregistered
Classname : vB_Database
MySQL Version :

Lynne
12-03-2010, 01:59 PM
"MySQL Server has gone away" is a server issue. See this: http://www.vbulletin.com/docs/html/troubleshoot_mysql_goneaway and this: http://www.vbulletin.com/forum/showthread.php?s=&postid=310265#post310265