![]() |
|
Article Options |
Work Around: Error SQL server exceeded max questions
Zachariah
Join Date: Feb 2002
Posts: 2,125
AS Electronics Experance in PHP, HTML, JavaScript, DHTML, Flash, XML, MySQL, Photoshop, more. Electronics I, II, III, Microprocessors, AC and DC Electronics, Boolean Algebra, Trig / Math Analysis, Chemistry / AP Physics Canoga Park, CA
by
![]() Rating:
![]() vBulletin: 3.0x / 3.5x / 3.6x / 3.7x / 3.8x
- The server it self auto temp bans the mysql account in use. I am sure others may have ran into this issue. I have ran into many webhosts that because of "server loads" have a cap on max questions mySQL server can be given in a time frame. (1 hour in my case) This becomes a huge problem when doing maintenance of "Update Counters" in the AdminCP. One workaround is to create multiple mysql users in your hosting account. In config.php you randomly pick one of these users to connect to the database. This will spread the questions between users and since the limit is per user. This is not a perfect solution for if an account maxes out the script will stop, but you can usually overcome the problem. I set up 7 accounts in mySQL up on 1 database all using the same password. I ran 236,968 queries without a hiccup. ![]() Edit: includes/config.php Find:
Replace with:
1) Make sure and replace user1, user2, user3, user4, user5, user6, user7 with the correct user names made for the database. 2) Also replace password with the correct password. The following members like this post: escavern
Last edited by Zachariah; 24 Feb 2009 at 14:12.. |
||||||||
Views: 13779
|
Comments |
#2
|
||||
|
||||
No members have liked this post.
Last edited by Sweeks; 06 Apr 2011 at 13:34. |
#3
|
||||
|
||||
Yep, no poblems.
With a few changes the concept should work with any php program that accesses mySql. No members have liked this post.
|
#4
|
||||
|
||||
Can this work around this error?
Hope it can avoid this if possible. ________ BOX VAPORIZER No members have liked this post.
Last edited by Sweeks; 06 Apr 2011 at 13:35. |
#5
|
||||
|
||||
It should in theory.
max_user_connections - this limits only the number of simultaneous connections made using a single account.
This little bit of code takes multiple mysql user accounts (all with the same password) and spread the questions between users at random. No members have liked this post.
|
#6
|
|||
|
|||
Does It Work With web hosting limit connection ?If the limit 25 we can get 100 if four user ?
Does It Speed Up the Forum and Increase the server load ? Thanks. No members have liked this post.
|
#7
|
||||
|
||||
There is no harm in trying. I have not ran into this problem to test for an answer.
The number of simultaneous connections to the server an account can have are limits per account. If there are multi accounts, I would think each account has a limit of 25 vs. each database with a max limit. Try it out and see if your problem goes away. Report back findings please ![]() No members have liked this post.
|
#8
|
||||||||||||||||||||
|
||||||||||||||||||||
. No members have liked this post.
|
#9
|
||||
|
||||
Thanks dude im using this
No members have liked this post.
|
#10
|
|||
|
|||
is this work for vbulletin 4?
No members have liked this post.
|
#11
|
||||
|
||||
No members have liked this post.
|
#12
|
||||
|
||||
first of though this will make forum loading fast but after i adding more Mysql users but it made forum loading very slow
![]()
__________________
website No members have liked this post.
|
#13
|
||||
|
||||
Originally Posted by Zachariah
This isn't working for some reason... where does the database name 'username' get inserted or replaced, as in the original instructions?![]()
My Database: $config['Database']['dbtype'] = 'mysqli'; No members have liked this post.
Last edited by Poker Face; 19 Dec 2010 at 03:09. |
#14
|
|||
|
|||
This is genius. I didn't want to change servers and Hostgator can be a real pain in the ass. I did this and the forum was INSTANTLY faster and the hundreds of errors in my email have stopped(for now..let it continue). Thanks a ton man!
No members have liked this post.
|
#15
|
||||
|
||||
Only until they catch you. They've limited you to 25 connections per account, not per user (which would basically be unlimited connections).
No members have liked this post.
|
![]() |
«
Previous Article
|
Next Article
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Article Options | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 16:55.