Need to add multiple users to database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LoTGoD
    New Member
    • Aug 2005
    • 28
    • 3.0.8

    Need to add multiple users to database

    Hi,
    I keep getting the following error

    Database error in vBulletin :

    Link-ID == false, connect failed
    mysql error:

    mysql error number: 0

    Date: Wednesday 26th of October 2005 10:57:12 AM
    Script: http://www.xxx.xxx/forum/private.php?
    Referer: http://www.xxx.xxx/forum/forumdisplay.php?f=14
    IP Address: XXX.XXX.XXX.XXX

    I was told that since my ISP has instituted a 50000 user per hour limit on the MySQL server, allowing multiple users to access the database could correct this issue. Since I can't code PHP very well, I was wondering if someone could write some code to allow this. I can give as many users access to the database as needed.

    if possible, please use the following format :

    XXX_vbuser1
    XXX_vbuser2
    etc...

    I can replace XXX with my prefix for my specific installation.
    Any help on this is appreciated. Thanks!!

    Aaron
  • Colin F
    Senior Member
    • May 2004
    • 17689

    #2
    That would require code modification.
    It might be possible to use two different users though by upgrading to 3.5 and setting one user as the slave_server.
    Best Regards
    Colin Frei

    Please don't contact me per PM.

    Comment

    • LoTGoD
      New Member
      • Aug 2005
      • 28
      • 3.0.8

      #3
      I see. I was just getting my info from this post :

      I'm getting this error for sometimes since upgrade:''There seems to have been a problem with the database. Please try again by clicking the Refresh button in your web browser.An E-Mail has been dispatched to our Technical Staff, whom you can also contact if the problem persists.We apologise for any inconvenience.''there is no


      Does that explain things any better?

      Comment

      • LoTGoD
        New Member
        • Aug 2005
        • 28
        • 3.0.8

        #4
        Can this be done? The more I think about it, the less it makes sense. Isn't the limit imposed by my ISP what is getting hit each hour? How would adding multiple users would have no effect on this.

        Comment

        • Colin F
          Senior Member
          • May 2004
          • 17689

          #5
          It can be done.
          The problem is that the limit your ISP has imposed doesn't make sense. On one hand they limit you, but on the other hand they give you options to bypass this limit.

          Try using the attached config.php file.
          Adjust the variables as usual, but in this part:
          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['1']['user'] = 'root';
          $dblogins['1']['pass'] = '';

              
          //    ****** MASTER DATABASE USERNAME & PASSWORD ******
              //    This is the username and password you use to access MySQL.
              //    These must be obtained through your webhost.
          $dblogins['2']['user'] = '';
          $dblogins['2']['pass'] = '';

              
          //    ****** MASTER DATABASE USERNAME & PASSWORD ******
              //    This is the username and password you use to access MySQL.
              //    These must be obtained through your webhost.
          $dblogins['3']['user'] = '';
          $dblogins['3']['pass'] = ''
          Add the login details for different users to the variables.
          Attached Files
          Best Regards
          Colin Frei

          Please don't contact me per PM.

          Comment

          • LoTGoD
            New Member
            • Aug 2005
            • 28
            • 3.0.8

            #6
            Thanks Colin...tried that and I haven't had any errors since. I'll keep an eye on it and post up if something happens that is not expected. Thanks again!!!

            Comment

            • Zachariah B
              Senior Member
              • Feb 2002
              • 211
              • 4.0.0

              #7
              Originally posted by Colin F
              It can be done.
              The problem is that the limit your ISP has imposed doesn't make sense. On one hand they limit you, but on the other hand they give you options to bypass this limit.

              Try using the attached config.php file.
              Adjust the variables as usual, but in this part:
              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['1']['user'] = 'root';
              $dblogins['1']['pass'] = '';

                  
              //    ****** MASTER DATABASE USERNAME & PASSWORD ******
                  //    This is the username and password you use to access MySQL.
                  //    These must be obtained through your webhost.
              $dblogins['2']['user'] = '';
              $dblogins['2']['pass'] = '';

                  
              //    ****** MASTER DATABASE USERNAME & PASSWORD ******
                  //    This is the username and password you use to access MySQL.
                  //    These must be obtained through your webhost.
              $dblogins['3']['user'] = '';
              $dblogins['3']['pass'] = ''
              Add the login details for different users to the variables.
              Hello,

              I have tested this out.
              Reindex of forums search.

              Processing: 102279 ... Done
              Processing: 102281 ... Querying first post of thread... Done
              Processing: 102282 ... Done
              Processing: 102283 ...

              Invalid SQL:
              INSERT IGNORE INTO word (title) VALUES ('annnnnnything');

              MySQL Error : User 'root4' has exceeded the 'max_questions' resource (current value: 50000)
              Error Number : 1226
              $dblogins['1']['user'] = 'root2';
              $dblogins['2']['user'] = 'root3';
              $dblogins['3']['user'] = 'root4';


              I think this could use some sort of:
              - counter in session memory per user and stop using account when close to 50k.
              - IF mysql connect gives error ER_USER_LIMIT_REACHED (Error Number : 1226) THEN skip that user and use the next one.
              Last edited by Zachariah B; Wed 1 Mar '06, 5:34am.
              http://www.szone.us | http://www.gzhq.net
              Twitter | Facebook | My:Hacks @ vBulletin.org
              Member of Kiwanis Club of Chatsworth

              Comment

              • ToneZ0r
                New Member
                • Mar 2008
                • 7
                • 3.6.x

                #8
                Apologies for the naive question - but in this instance:

                // ****** MASTER DATABASE USERNAME & PASSWORD ******
                // This is the username and password you use to access MySQL.
                // These must be obtained through your webhost.
                $dblogins['1']['user'] = 'root';
                $dblogins['1']['pass'] = '';

                // ****** MASTER DATABASE USERNAME & PASSWORD ******
                // This is the username and password you use to access MySQL.
                // These must be obtained through your webhost.
                $dblogins['2']['user'] = '';
                $dblogins['2']['pass'] = '';

                // ****** MASTER DATABASE USERNAME & PASSWORD ******
                // This is the username and password you use to access MySQL.
                // These must be obtained through your webhost.
                $dblogins['3']['user'] = '';
                $dblogins['3']['pass'] = '';

                Do I need to change anything? Do I need to change the parts in red? Or can I simply attach Colin's text file 'as is' (with the changes that are stated in the VB install tutorial of course!).

                Comment

                • bonjurkes
                  Senior Member
                  • Apr 2005
                  • 257
                  • 3.6.x

                  #9
                  you bumped a 2 year old thread lol

                  If you also want to do same as the topic creator wants to do, you don`t need to edit anything Colin gave. Just put the login information and upload it

                  Comment

                  • peterska2
                    Senior Member
                    • Oct 2003
                    • 8869
                    • 3.7.x

                    #10
                    Please note that this will only work on vBulletin 3.0.x If you are running vBulletin 3.5.0 or later then this will not work as there have been extensive changes to the config.php file.

                    Comment

                    • Zachariah B
                      Senior Member
                      • Feb 2002
                      • 211
                      • 4.0.0

                      #11
                      It still works in 3.8x

                      - I had to get by the 50K heart break again.
                      - and was able to do all maintance and counter updates.

                      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';
                      http://www.szone.us | http://www.gzhq.net
                      Twitter | Facebook | My:Hacks @ vBulletin.org
                      Member of Kiwanis Club of Chatsworth

                      Comment

                      • nozafc
                        New Member
                        • Nov 2008
                        • 2
                        • 3.7.x

                        #12
                        Thanks for the above code, solved my annoying issue

                        Comment

                        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                        Working...