Results 1 to 2 of 2

Work Around: Error SQL server exceeded max questions

This is a discussion on Work Around: Error SQL server exceeded max questions within the Member Articles forums, part of the Focus on Members category; vBulletin: 3.0x / 3.5x / 3.6x / 3.7x / 3.8x "Error: SQL server exceeded 50,000 max questions" - All mySQL ...

  1. #1
    Member Zachariah's Avatar
    Real Name
    Zachariah
    Join Date
    May 2007
    Location
    Canoga Park, CA
    Posts
    32
    Liked
    0 times

    Work Around: Error SQL server exceeded max questions

    vBulletin: 3.0x / 3.5x / 3.6x / 3.7x / 3.8x

    "Error: SQL server exceeded 50,000 max questions"
    - All mySQL is stopped for like 5 min then all is ok.
    - 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:
    PHP Code:
    //***** MASTER DATABASE USERNAME & PASSWORD ****** 
    //    This is the username and password you use to access MySQL. 
    //    These must be obtained through your webhost. 

    $config['MasterServer']['username'] = '';
    $config['MasterServer']['password'] = ''
    Replace with:
    PHP Code:
    //***** MASTER DATABASE USERNAME & PASSWORD ******
    //    This is the username and password you use to access MySQL.
    //    These must be obtained through your webhost.
    $dblogins = array();

    $dblogins['1']['user'] = 'user1';
    $dblogins['2']['user'] = 'user2';
    $dblogins['3']['user'] = 'user3';
    $dblogins['4']['user'] = 'user4';
    $dblogins['5']['user'] = 'user5';
    $dblogins['6']['user'] = 'user6';
    $dblogins['7']['user'] = 'user7';

    srand((float) microtime() * 10000000);
    $dbloginid array_rand($dblogins);
    while (
    $dblogins[$dbloginid]['user'] == '')
    {
        
    $dbloginid array_rand($dblogins);
    }
    $config['MasterServer']['username'] = $dblogins[$dbloginid]['user'];

    unset(
    $dblogins$dbloginid);

    $config['MasterServer']['password'] = 'password'
    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.
    Last edited by Zachariah; 02-24-2009 at 06:14 PM.

  2. #2
    vBSEO.com Webmaster Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    22,367
    Liked
    542 times
    Blog Entries
    4
    Very good idea
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

Similar Threads

  1. CPU exceeded
    By AliMH in forum Troubleshooting
    Replies: 1
    Last Post: 08-14-2008, 02:21 PM
  2. Will Vbseo work on server window?
    By dinhchi.com in forum Pre-Sales Questions
    Replies: 3
    Last Post: 12-07-2007, 11:32 AM
  3. Moved site to new server and won't work :(
    By gedsta in forum URL Rewrite Settings
    Replies: 11
    Last Post: 12-07-2007, 10:07 AM
  4. Server Load Questions.
    By MikeWarner in forum Troubleshooting
    Replies: 18
    Last Post: 02-07-2007, 09:48 AM
  5. upgraded server and zend doesnt work
    By SouthernTn in forum Troubleshooting
    Replies: 5
    Last Post: 03-03-2006, 11:01 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •