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

Moderator: mcsmom

Post Reply
User avatar
maverick25
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Aug 18, 2005 12:38 pm
Location: Marikina City, Philippines
Contact:

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

Post by maverick25 » Wed Oct 12, 2005 3:55 am

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.

User avatar
Websmurf
Joomla! Intern
Joomla! Intern
Posts: 92
Joined: Fri Aug 19, 2005 2:23 pm
Location: The Netherlands
Contact:

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

Post by Websmurf » Wed Oct 12, 2005 10:23 am

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..
Adam van Dongen - Developer

- Blocklist, ODT Indexer, EasyFAQ, Easy Guestbook, Easy Gallery, YaNC & Redirect -
http://www.joomla-addons.org - http://www.bandhosting.nl

User avatar
maverick25
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Aug 18, 2005 12:38 pm
Location: Marikina City, Philippines
Contact:

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

Post by maverick25 » Thu Oct 13, 2005 3:19 am

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.

danilop

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

Post by danilop » Sun Aug 06, 2006 3:22 am

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!!

thomas_ttech

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

Post by thomas_ttech » Fri Sep 15, 2006 7:09 pm

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 !!!

User avatar
Websmurf
Joomla! Intern
Joomla! Intern
Posts: 92
Joined: Fri Aug 19, 2005 2:23 pm
Location: The Netherlands
Contact:

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

Post by Websmurf » Sat Sep 16, 2006 8:16 pm

No, the only way to get around this error, is to use multiple users or to ask your hosting provider to upgrade the limit
Adam van Dongen - Developer

- Blocklist, ODT Indexer, EasyFAQ, Easy Guestbook, Easy Gallery, YaNC & Redirect -
http://www.joomla-addons.org - http://www.bandhosting.nl

maniactive

How to fix DB function failed with error number 1226?

Post by maniactive » Tue Dec 05, 2006 9:15 pm

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!

chanman
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sat Oct 07, 2006 8:18 pm

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

Post by chanman » Mon Dec 25, 2006 8:09 am

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.

chanman
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sat Oct 07, 2006 8:18 pm

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

Post by chanman » Thu Dec 28, 2006 7:23 pm

problem solved.

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

chanman
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sat Oct 07, 2006 8:18 pm

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

Post by chanman » Tue Jan 16, 2007 6:01 am

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.

Patsbrady
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sun Aug 28, 2005 9:14 am

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

Post by Patsbrady » Wed Jan 17, 2007 6:04 pm

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??

chanman
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sat Oct 07, 2006 8:18 pm

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

Post by chanman » Wed Jan 24, 2007 2:15 am

u dont' need to actually

replace the .htaccess with original one.

heltsonika

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

Post by heltsonika » Mon Feb 12, 2007 9:00 pm

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?

User avatar
lcdude
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Thu Aug 10, 2006 4:27 pm
Location: USA

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

Post by lcdude » Tue May 01, 2007 12:45 am

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
Last edited by lcdude on Tue May 01, 2007 10:26 pm, edited 1 time in total.
Lcdude

chanman
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sat Oct 07, 2006 8:18 pm

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

Post by chanman » Tue May 01, 2007 12:48 am

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)

User avatar
lcdude
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Thu Aug 10, 2006 4:27 pm
Location: USA

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

Post by lcdude » Tue May 01, 2007 1:18 am

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".
Last edited by lcdude on Tue May 01, 2007 1:58 am, edited 1 time in total.
Lcdude

User avatar
lcdude
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Thu Aug 10, 2006 4:27 pm
Location: USA

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

Post by lcdude » Tue May 01, 2007 11:21 pm

Chanman

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

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

Thankx
Lcdude

ssimxp

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

Post by ssimxp » Wed May 23, 2007 12:40 pm

i undestand ....how disable? Joomla Core SEF

User avatar
lcdude
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Thu Aug 10, 2006 4:27 pm
Location: USA

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

Post by lcdude » Wed May 23, 2007 4:14 pm

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
Lcdude

User avatar
Hils
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Aug 22, 2005 3:31 pm
Location: Norfolk, UK
Contact:

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

Post by Hils » Fri May 25, 2007 12:04 pm

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.
It's nice to be nice!

Cory Nelkin

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

Post by Cory Nelkin » Sat Aug 11, 2007 9:02 pm

That sounds like it should work

France
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Oct 09, 2007 6:34 pm

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

Post by France » Tue Oct 09, 2007 8:51 pm

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.

khampster

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

Post by khampster » Wed Dec 19, 2007 6:48 pm

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?

poseidon

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

Post by poseidon » Fri Feb 08, 2008 11:12 am

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

poseidon

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

Post by poseidon » Sat Feb 09, 2008 8:35 pm

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


Post Reply