General Error SQL ERROR [ mysql4 ]

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Scam Warning
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
donnak78631
Registered User
Posts: 30
Joined: Wed Mar 15, 2006 3:22 pm

Re: General Error SQL ERROR [ mysql4 ]

Post by donnak78631 »

General Error
SQL ERROR [ mysql4 ]

Access denied for user 'swcsgrandma'@'64.202.163.149' (using password: YES) [1045]

An sql error occurred while fetching this page. Please contact an administrator if this problem persists.
General Error
SQL ERROR [ mysql4 ]

Unknown MySQL server host 'h41mysql63.secureserver.net' (2) [2005]

An sql error occurred while fetching this page. Please contact an administrator if this problem persists.

I am told this is a Software problem not a SERVER Problem....I would just like to tell my many members what the damn problem is and when it may be fixed, or better yet. RECIEVE some instruction on how to fix it...




Dear Donna Bogart,

Thank you for contacting Online Support. I am sorry for the confusion. It is to my understanding that you are having problems with your database. It appears that you are using a custom application for your hosting account. Unfortunately we are unable to assist you with custom applications. Please make sure you are using the correct connection string for your application. You can view an example connection string by going to the link below:

MySQL Connection String with PHP

Please let us know if we can assist you in any other way.

Best Regards,
Shawn C.
Online Support Representative
User avatar
goBlu
Registered User
Posts: 16
Joined: Thu Mar 27, 2008 5:44 pm
Location: Canada
Contact:

Re: General Error SQL ERROR [ mysql4 ]

Post by goBlu »

I'm getting this error .... not sure why, works fine on my host just not on my DEV machine.
SQL ERROR [ mysql4 ]

[]

SQL

SELECT t.*, f.* FROM (phpbb_forums f, phpbb_topics t) WHERE t.topic_id = 1 AND (f.forum_id = t.forum_id OR (t.topic_type = 3 AND f.forum_id = 2))

BACKTRACE

FILE: includes/db/mysql.php
LINE: 158
CALL: dbal->sql_error()

FILE: :viewtopic.php
LINE: 193
CALL: dbal_mysql->sql_query()

FILE: :title.php
LINE: 258
CALL: include('viewtopic.php')
The Future is Blu!
http://www.goBlu.ca
FREE Blu-ray Disc giveaway, visit the website for details.
bbrunnrman
Registered User
Posts: 80
Joined: Sun Dec 24, 2006 9:19 pm

Re: General Error SQL ERROR [ mysql4 ]

Post by bbrunnrman »

While many possible errors can be covered by the title of this thread (General Error SQL ERROR [ mysql4 ]), most posts seem to be concerned with two kinds of MySQL errors:
Error #1040 ('max_connections' exceeded)
Error #1203 ('max_user_connections' exceeded)
although posters haven't always said explicitly which error they experienced. (I was guilty of this myself in my previous post at http://www.phpbb.com/community/viewtopi ... 5#p4876775 but I'll note that mine was the #1203 error.)

One thing I'm curious about: Can anyone explain the exact difference between the 'max_connections' and 'max_user_connections' variables? Both involve simultaneous connections. Do they play essentially the same role? What values do hosts typically set for these parameters?

What can be causing all these errors? Marshalrusty pointed out in post http://www.phpbb.com/community/viewtopi ... 5#p4177865 that every process in phpBB3 closes its DB connections when it finishes. This leaves the question: What if a process fails to finish normally but dies with, say, an "Internal Server Error." Wouldn't that leave an open DB connection?

It's possible that phpBB3 is more prone to Internal Server Errors than phpBB2. For one thing, they can occur when running the phpBB2 to 3 converter. As I explained in another thread in post http://www.phpbb.com/community/viewtopi ... 5#p4864675 - when I ran the converter, I restarted it repeatedly after it died with Internal Server Errors. (I was aware that the conversion can be done offline as described at http://www.phpbb.com/kb/article/offline-conversions/ - but the brute force method of restarting repeatedly after errors just seemed so much easier. And I'm sure a lot of other people have done it the way I did.)

By checking our server logs, I've determined that when I ran the converter (a week ago from today), I restarted 43 times after errors. Then, when I rebuilt the Search index following conversion, I restarted another 18 times after errors. Those errors during the conversion and search index rebuilding may have already left a bunch of open DB connections, increasing the likelihood of hitting my host's limit after we went live with phpBB3.

A scan of our server logs shows that some Internal Server Errors ("500" status codes) continued to happen during normal operation of our phpBB3 board. They've happened during various operations such as searching, posting, viewing topics, UCP and ACP. But the greatest number of these "500" errors, by far, appear to be connected with the cron.php script. This suggests the possibility that cron.php may be buggy, so the developers ought to examine it very carefully.

Meanwhile, in an effort to limit the problem, I'm experimenting to see if bumping up PHP's memory limit would help. Depending on your host, you may or may not have any ability to do this. In my case, although I'm on a shared host, they do allow each account its own php.ini file. The default memory_limit in these files is provided as 32M, but I've tried increasing it to 60M which is, I believe, the maximum that the host's shared servers will allow. It's unclear whether this will reduce the number of "500" errors, although the board does seem somewhat "zippier" since I did it about 9.5 hours ago. During this period, the server log shows just one "500" error - and it happened in a "cron.php" process.
smackeddown
Registered User
Posts: 7
Joined: Sun Mar 30, 2008 12:44 am

Re: General Error SQL ERROR [ mysql4 ]

Post by smackeddown »

Heres a solution that worked for me and many other to the internal server error with time outs.

http://www.muhdzamri.blogspot.com/2007/ ... hpbb3.html

It prevented me from doing an offline conversion.
Revs
Registered User
Posts: 100
Joined: Thu Jan 24, 2008 1:01 pm

Re: General Error SQL ERROR [ mysql4 ]

Post by Revs »

Hello,

when I access any topic it shows me this message :
General Error
SQL ERROR [ mysql4 ]

Got error 127 from storage engine [1030]

SQL

SELECT session_user_id, MAX(session_time) as online_time, MIN(session_viewonline) AS viewonline FROM board_sessions WHERE session_user_id IN ('56', '2', '55') GROUP BY session_user_id

BACKTRACE

FILE: includes/db/mysql.php
LINE: 158
CALL: dbal_mysql->sql_error()

FILE: viewtopic.php
LINE: 1134
CALL: dbal_mysql->sql_query()
What should I do ? Thanks.
User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: General Error SQL ERROR [ mysql4 ]

Post by karlsemple »

Using phpmyadmin run a repair on your boards database tables and then test to see if that cures the problem :)
Image
Revs
Registered User
Posts: 100
Joined: Thu Jan 24, 2008 1:01 pm

Re: General Error SQL ERROR [ mysql4 ]

Post by Revs »

Works now, thanks very much :).
strngr12
Registered User
Posts: 158
Joined: Sun Jun 16, 2002 2:11 am
Contact:

Re: General Error SQL ERROR [ mysql4 ]

Post by strngr12 »

Marshalrusty wrote:*snip*
So you're telling me that when I have two bots, two registered members and three guests online that the reason I get this error is because my host has it's mysql connections set too low? Why then when I had hundreds of guests and a dozen or more people logged into my phpbb2 board on the same host did I not get that error? I had phpbb2 for many, many years and never saw anything like that, further I had to go into phpMyAdmin after the site came back up and repair the posts table because whatever went wrong crashed that table. When I logged into phpMyADmin the posts table said "In Use" and there was no one online at all at the time becaquse they had all been kicked by the MySql error. There's a phpbb error here. It's just as easy for the script developer to blame the host as it is for the host to blame the script.
goethe
Registered User
Posts: 162
Joined: Fri May 11, 2007 8:26 pm

Re: General Error SQL ERROR [ mysql4 ]

Post by goethe »

I suspect you are having one of a number of problems:
  1. YOU misconfigured your PHP board or you screwed something up along the line. Thousands of people are using phpBB 3.0.x Gold without any of the errors you are recieving.
  2. You are at the recieving end of a DoS attack which is eating up your SQL connections and ports and preventing log ins and causing trouble with the "500" errors
  3. Your version of PHP or MySQL is incorrect. Contact your host to see if they are up to date on the recent versions of PHP and MySQL.
I can translate German in both directions:
German to English
English to German
If you want a translation, drop me a PM.
strngr12
Registered User
Posts: 158
Joined: Sun Jun 16, 2002 2:11 am
Contact:

Re: General Error SQL ERROR [ mysql4 ]

Post by strngr12 »

goethe wrote:I suspect you are having one of a number of problems:
  1. YOU misconfigured your PHP board or you screwed something up along the line. Thousands of people are using phpBB 3.0.x Gold without any of the errors you are recieving.
  2. You are at the recieving end of a DoS attack which is eating up your SQL connections and ports and preventing log ins and causing trouble with the "500" errors
  3. Your version of PHP or MySQL is incorrect. Contact your host to see if they are up to date on the recent versions of PHP and MySQL.
All of us? I'm not being DoS'd, my MySql version in phpMyAdmin and in the board's admin panel match, the php version is correct and if it's somethiing that's screwed up in the way the board is configured, well, that's why we're here, right? If everyone configured everything correctly all the time there would be no need for a support forum. I just read through this whole subject and it has been consistantly ignored even though it's currently one of the longest threads on the front page of this forum. Wether there are 1,000s of people using the script with no problem I think the number of people posting in this thread show that this particular problem deserves some investigation on the part of the support apparatus. I just upgraded Friday and have had this problem everyday since then and it appears to be getting worse as this last time, just a half hour ago, it crashed my DB all together.
goethe
Registered User
Posts: 162
Joined: Fri May 11, 2007 8:26 pm

Re: General Error SQL ERROR [ mysql4 ]

Post by goethe »

Well, it would probably make it easier to fix everyones' issues if you all had sepparate threads, as your problems may be unique.

Good luck with this though. Since you used the converter there is a chance that something went wrong. But I suspect that you may have so much as bumped the "." key while looking in a file and that could have bad effects. There are thousands of possibilities. Try backing up your saved version of phpBB2 and re-running the coverter with a fresh download.
I can translate German in both directions:
German to English
English to German
If you want a translation, drop me a PM.
strngr12
Registered User
Posts: 158
Joined: Sun Jun 16, 2002 2:11 am
Contact:

Re: General Error SQL ERROR [ mysql4 ]

Post by strngr12 »

But other than the error which, while it does pop up everyday, only last a few minutes to a half hour everything else works fine. When the board is up, which is most of the time, it's zippy, everyone logs in fine, posts work fine... there are no other errors save this one and I think, from what everyone else says, it seems to be related to search. That's more specific than just a bunch of people saying, "my board's slow."
Paulo Amaral
Registered User
Posts: 1
Joined: Wed Apr 02, 2008 12:55 pm

Re: General Error SQL ERROR [ mysql4 ]

Post by Paulo Amaral »

Same problem here:
General Error
SQL ERROR [ mysql4 ]

User XXXXX_yyyy has already more than 'max_user_connections' active connections [1203]

An sql error occurred while fetching this page. Please contact an administrator if this problem persists.
What's the solution other than switching host?
strngr12
Registered User
Posts: 158
Joined: Sun Jun 16, 2002 2:11 am
Contact:

Re: General Error SQL ERROR [ mysql4 ]

Post by strngr12 »

Try switching your search method. It's worked for me so far.
gentrification
Registered User
Posts: 5
Joined: Wed Jan 30, 2008 11:14 pm

Re: General Error SQL ERROR [ mysql4 ]

Post by gentrification »

What hosts have confirmed working with no problems? Also, what searching method did you switch to that stopped your problems.

My sites been down all day. When I try to repair the mysql database, this is what I'm getting from my hosts admin page:

Application error
Rails application failed to start properly

and it will never start. I've checked the db, and everything looked ok. What can I do to make this stop?!?!
Locked

Return to “[3.0.x] Support Forum”