Page 1 of 1

FAQ: How to fix DB function failed with error number 1226?

Posted: Wed Oct 12, 2005 3:55 am
by maverick25
FOR SHARED ENVIRONMENTS ONLY

If your site crashed due to this error:

Code: Select all

DB function failed with error number 1226
User 'your_user_name_here' has exceeded the 'max_questions' resource (current value: 50000) SQL=SELECT session_id FROM mos_session WHERE session_id=MD5('1aa637c8e7d13c9be419d455cd6db64c')
SQL =

SELECT session_id FROM mos_session WHERE session_id=MD5('1aa637c8e7d13c9be419d455cd6db64c')

and you are currently hosted on a shared environment (i.e., you are not allowed to edit configuration files for PHP and MySQL or your host provider doesn't want to increase the max_questions value), here is a quick fix:

  • Go to your account's control panel (e.g., CPanel, DirectAdmin, vDeck, etc.). Access the MySQL feature and create 2-5 database users with the same password as your db user for Mambo/Joomla. Assign them to the database where your Mambo/Joomla site is.

    Example:
    DB name for Mambo/Joomla - myjoomla_cms
    DB user for Mambo/Joomla - myjoomla_user

    Create additional users for the database:
    2nd DB user for Mambo/Joomla - myjoomla_user1
    3rd DB user for Mambo/Joomla - myjoomla_user2

    Don't forget to give them the same database privileges as your first Joomla DB user.

  • Then download your configuration.php from the server and open it in any HTML/PHP editor to modify it.

    Look for this line:

Code: Select all

$mosConfig_user = 'myjoomla_user';


Comment out the line above and add these lines below it:

Code: Select all

$mosConfig_users = array("myjoomla_user", "myjoomla_user1", "myjoomla_user2");
$mosConfig_user = $mosConfig_users[array_rand($mosConfig_users)];

    Explanation: The first line defines the users that can access your database. The second line randomly selects a user from the list on the first line.

    Save the changes and re-upload the file to your server.

Re: FAQ: How to fix DB function failed with error number 1226?

Posted: Wed Oct 12, 2005 10:23 am
by Websmurf
Please keep in mind, that making a change to your site configuration through the mambo backend and saving it, will overwrite the configuration.php file and will force you to do the change again..

Re: FAQ: How to fix DB function failed with error number 1226?

Posted: Thu Oct 13, 2005 3:19 am
by maverick25
What Websmurf said is true, so unless you know what you are doing and you think that your current site's configuration is what you really want, then you can make your configuration.php unwritable to keep the changes you manually entered saved.

Re: FAQ: How to fix DB function failed with error number 1226?

Posted: Sun Aug 06, 2006 3:22 am
by danilop
hi!, sorry my bad english, i speak spanish.
Your explanation solve me the problem for some weeks, but i have the same problem again  :-[ , i think that maybe the problem is (in my case) in the 404 sef, i don't know why this component create every day a lot of 404 error pages  :'( any suggestion? thanks!!

Re: FAQ: How to fix DB function failed with error number 1226?

Posted: Fri Sep 15, 2006 7:09 pm
by thomas_ttech
Has anyone found the root of the problem ?

Has anyone found a solution besides adding users to the database ? (not an option with some hosting packages such as mine  :( )

I know someone was hosting with servage, have they found a solution ???

Thanks in advance !!!

Re: FAQ: How to fix DB function failed with error number 1226?

Posted: Sat Sep 16, 2006 8:16 pm
by Websmurf
No, the only way to get around this error, is to use multiple users or to ask your hosting provider to upgrade the limit

How to fix DB function failed with error number 1226?

Posted: Tue Dec 05, 2006 9:15 pm
by maniactive
This "array" tip worked like a charm for me. It also worked at an osCommerce installation. So thank you v. much!

One other thing I noticed: I did not get the 1226 error until I installed Wordpress on the same shared server space as Joomla!

This happened twice on two different shared server solutions with the 50,000 question limit:

my solution in each case was to 1) do the array AND 2) get rid of any trace of Wordpress.

It doesn't appear that WordPress and Joomla play nice with each other on the same shared server space.

But I'd love it if someone could prove me wrong!

Re: FAQ: How to fix DB function failed with error number 1226?

Posted: Mon Dec 25, 2006 8:09 am
by chanman
It doesn't work! Is there any way to find the SOURCE of this problem?

I only get 15-20 unique users a day...and this happens very frequently.

Re: FAQ: How to fix DB function failed with error number 1226?

Posted: Thu Dec 28, 2006 7:23 pm
by chanman
problem solved.

disable all stats, joomlastats, config stats option
make like 30-40 user names, not only 2-5...
and make the array humongous

Re: FAQ: How to fix DB function failed with error number 1226?

Posted: Tue Jan 16, 2007 6:01 am
by chanman
EDIT!

problem was NOT solved by the above.


I HAVE FOUND THE SOURCE OF THIS PROBLEM.

When I disable Joomla Core SEF, everything works perfectly. PERFECTLY.

Re: FAQ: How to fix DB function failed with error number 1226?

Posted: Wed Jan 17, 2007 6:04 pm
by Patsbrady
I HAVE FOUND THE SOURCE OF THIS PROBLEM.

When I disable Joomla Core SEF, everything works perfectly. PERFECTLY.


How do you disable the Joomla core SEF??

Re: FAQ: How to fix DB function failed with error number 1226?

Posted: Wed Jan 24, 2007 2:15 am
by chanman
u dont' need to actually

replace the .htaccess with original one.

Re: FAQ: How to fix DB function failed with error number 1226?

Posted: Mon Feb 12, 2007 9:00 pm
by heltsonika
chanman wrote:EDIT!

problem was NOT solved by the above.


I HAVE FOUND THE SOURCE OF THIS PROBLEM.

When I disable Joomla Core SEF, everything works perfectly. PERFECTLY.



That doesn't work for me...

Does anyone know the cause of this problem yet?

Re: FAQ:Could this be moved please I posted in the wrong place - thankx

Posted: Tue May 01, 2007 12:45 am
by lcdude
Has anyone come up with the REAL cause of this error 1226. I have tried the work arounds and our site stays up about a month and then 1226 again.

I do not want to shut off my SEO core. I am using Artio SEF component - could it be the cause. I am now in a bad situation with 4 joomla sites 2 that are going down daily.

I empty the JOS_SESION table daily in fact I just did it and the site went down in less than 10 mins.

I am a NEWBIE only using joomla a few months. These work arounds are difficult to do. Our HOST is of NO HELP and tells us "Joomla is poorly written software so what do we expect". The fact that it running on millions of site seems to be lost on them.

I could and would surely appreciate some help! :P

ThankxBTW I would be happy to PM you and grant you admin access as this could also be something WE are doing. I just did a search for "error 1226" and we are the first 3. However I did also  note there are a lot of people who can't login to there "ADMIN" and get no admins setup. This is a common message when the error 1226 is happening. One other intersting note our site will come back online by itself in 15 mins or so. BUT if you do not flush the tables it goes down again.

Also read up on MYSQL and have learned how to to a CHECK and REAPAIR and OPTIMIZE all of which appear to be fine. It says the tables are AOL and uptodate.

One more question please Does 1.5 have this problem?


Update May 1 2007

I just realized that I posted in the wrong area this FAQ not General questions - Sorry! When I searched error 1226 the FAQ post was under mine so I thought I was in the right place. Could this be moved to Greneral Questions?
The reason is the person who answered my questions was CORRECT Artio SEF was the cause. I deleted it and now have LOST all my SEF urls in all the search engines and everyone comin to the site now gets a 404. I need to know how to fix all this (the site no longer crashes error 1226). However as Vanesa Fox of google says /com/view/123/156 or session=id12 url is not going to cut in a sitemap.xml file.

I know I can't recover whats lost is lost and whats done is done. However other joomla sites have nice friedly urls, so hows it done. I do not want to loose 6 months worth of work. I need some help and some good advice...thankx

Re: FAQ: How to fix DB function failed with error number 1226?

Posted: Tue May 01, 2007 12:48 am
by chanman
Artio SEF does have a problem .  (I had it, and i had the problem)

solutions:

1. disable Joomla Core SEF
2. uninstall ARTIO SEF
3. replace .htaccess with new one.
4. enable joomla core sef
see if that works

if that doesn't, then disable your stats.

1226 problem occurs when too many calls to the database are made (and this usually happens with SEF)

Re: FAQ: How to fix DB function failed with error number 1226?

Posted: Tue May 01, 2007 1:18 am
by lcdude
Ok thanks I give it a shot. BTW I already have stats core off. But we do have the bsqstats component should I delete that one off too. ???

Is there any othe componet or whatever to solve the SEF's problem. Google is always complaining about session id#'s and joomla is used as there example. I have spent almost all my time trieng to SEO the sites we have. We come up in hte first 10 of google and I like to keep it that way.

Does anyone know if 1.5 has the problem

Once again Joomla Support proves to be FAST and on target!

Update as of 10pm (note how fast support is for Joomla)

This is NOT a great solution our links in Google are now all "page not found".
I tried shuting it down (Artio SEF) and we lose our links. So untill I can find another way to SEF the site I will keep flushing the session table.

Sugestions and Comments are welcome...this is becoming a full time job. The site owner does not want to change host as I just read in another post this seems to be also a problem with "Ipowerweb".

Re: FAQ: How to fix DB function failed with error number 1226?

Posted: Tue May 01, 2007 11:21 pm
by lcdude
Chanman

Thank you! You were correct Artio Sef was at fault.

I still need help and requested this be moved to general questions

Thankx

Re: FAQ: How to fix DB function failed with error number 1226?

Posted: Wed May 23, 2007 12:40 pm
by ssimxp
i undestand ....how disable? Joomla Core SEF

Re: FAQ: How to fix DB function failed with error number 1226?

Posted: Wed May 23, 2007 4:14 pm
by lcdude
To disable the CORE SEO login as admin to the backend. On the top menu all the way to the left choose "SITE". When it comes up SEO is on your far right click there to disable. You should also disable stats if your having this problem.

Do a Search for "error 1226" and follow the threads there are some good tips for solving this problem.

What I did was enable debug (Same pace UNDER SITE) and found I had WAY to many inquires to the data base and most of them were Artio SEF. I was advised to switch to OPENSEF which I did.

You should also trim down your site and get rid of any modules, Components, Mambots etc that your not using or could live witout. We had over 250 inquires and now are down to 63. We no longer get the "ERROR 1226".

Also check the JOOMLA Performance section of the forum for advice.

This was an difficult task for us and two well over a week to fix. Take your time and listen the ones who know...joomla.

Good Luck

Re: FAQ: How to fix DB function failed with error number 1226?

Posted: Fri May 25, 2007 12:04 pm
by Hils
With reference to the first post in this thread - a quick workaround with no changes to the config file is, in cpanel, vdeck etc, delete the current user and immediately redo it with the same name and same password and set permissions as thought it was a new user. Only takes a couple of seconds.

Re: FAQ: How to fix DB function failed with error number 1226?

Posted: Sat Aug 11, 2007 9:02 pm
by Cory Nelkin
That sounds like it should work

Re: FAQ: How to fix DB function failed with error number 1226?

Posted: Tue Oct 09, 2007 8:51 pm
by France
heltsonika wrote:
chanman wrote:EDIT!

problem was NOT solved by the above.


I HAVE FOUND THE SOURCE OF THIS PROBLEM.

When I disable Joomla Core SEF, everything works perfectly. PERFECTLY.



That doesn't work for me...

Does anyone know the cause of this problem yet?


Indeed the cause of the problem is the SEF and the .htaccess file.
I experienced this error after installing ARTIO, and later also with OpenSEF.
I could not even access my admin interface!
By chance I have uploaded the right .htaccess file with the RewriteBase turned off :
  # RewriteBase /

And suddendly I got my site and admin back again!
I think the problem here is the settings of your htaccess file.

Re: FAQ: How to fix DB function failed with error number 1226?

Posted: Wed Dec 19, 2007 6:48 pm
by khampster
i have this issue and i have tried to fix my configuration.php file.. my forum works fine now.. its now joomla that is not working.. it tells me that it cannot connect to the database. i tried to log in to the admin page but it wont allow me to do it.. what seems to be the problem now?

Re: FAQ: How to fix DB function failed with error number 1226?

Posted: Fri Feb 08, 2008 11:12 am
by poseidon
lcdude wrote:To disable the CORE SEO login as admin to the backend. On the top menu all the way to the left choose "SITE". When it comes up SEO is on your far right click there to disable. You should also disable stats if your having this problem.

Do a Search for "error 1226" and follow the threads there are some good tips for solving this problem.

What I did was enable debug (Same pace UNDER SITE) and found I had WAY to many inquires to the data base and most of them were Artio SEF. I was advised to switch to OPENSEF which I did.

You should also trim down your site and get rid of any modules, Components, Mambots etc that your not using or could live witout. We had over 250 inquires and now are down to 63. We no longer get the "ERROR 1226".

Also check the JOOMLA Performance section of the forum for advice.



This was an difficult task for us and two well over a week to fix. Take your time and listen the ones who know...joomla.

Good Luck



i don't serach where is CORE SEO

Re: FAQ: How to fix DB function failed with error number 1226?

Posted: Sat Feb 09, 2008 8:35 pm
by poseidon
maverick25 wrote:FOR SHARED ENVIRONMENTS ONLY

If your site crashed due to this error:

Code: Select all

DB function failed with error number 1226
User 'your_user_name_here' has exceeded the 'max_questions' resource (current value: 50000) SQL=SELECT session_id FROM mos_session WHERE session_id=MD5('1aa637c8e7d13c9be419d455cd6db64c')
SQL =

SELECT session_id FROM mos_session WHERE session_id=MD5('1aa637c8e7d13c9be419d455cd6db64c')

and you are currently hosted on a shared environment (i.e., you are not allowed to edit configuration files for PHP and MySQL or your host provider doesn't want to increase the max_questions value), here is a quick fix:

  • Go to your account's control panel (e.g., CPanel, DirectAdmin, vDeck, etc.). Access the MySQL feature and create 2-5 database users with the same password as your db user for Mambo/Joomla. Assign them to the database where your Mambo/Joomla site is.

    Example:
    DB name for Mambo/Joomla - myjoomla_cms
    DB user for Mambo/Joomla - myjoomla_user

    Create additional users for the database:
    2nd DB user for Mambo/Joomla - myjoomla_user1
    3rd DB user for Mambo/Joomla - myjoomla_user2

    Don't forget to give them the same database privileges as your first Joomla DB user.

  • Then download your configuration.php from the server and open it in any HTML/PHP editor to modify it.

    Look for this line:

Code: Select all

$mosConfig_user = 'myjoomla_user';


Comment out the line above and add these lines below it:

Code: Select all

$mosConfig_users = array("myjoomla_user", "myjoomla_user1", "myjoomla_user2");
$mosConfig_user = $mosConfig_users[array_rand($mosConfig_users)];

    Explanation: The first line defines the users that can access your database. The second line randomly selects a user from the list on the first line.

    Save the changes and re-upload the file to your server.


but need too config the DB in the configuration.php file