• Welcome to PHPVIBE Forums. Please log in.

Can we change db user to avoid exceeding the db max_questions limit on our hosts

Started by YoSethos,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

YoSethosTopic starter

Hi there,

I have created a large website based on phpvibe.com and, believe it or not, it is a coloring pages website, heavily modified by myself.
You can check it here : www.kizicolor.com

My host has a db max_questions limit of 75000. I have created multiple database users for the same database.
What I want to ask you is this: how can I modify the vibe_config.php file in order to change the username based on an array of usernames every 45 minutes, to say ?

I found this code on a website but I don't really know how to modify it for the vibe_config file...
$dbusers =array (
  0 => array(
    'username' => 'user1',
    'password' => 'user1'
  ),
  1 => array(
    'username' => 'user2',
    'password' => 'user2'
  )
  );
  $dbindex =array_rand($dbusers);

$databases['default']['default'] = array (
  'database' => 'mydb',
  'username' => $dbusers[$dbindex]['username'],
  'password' => $dbusers[$dbindex]['password'],
  'prefix' => '',
  'host' => 'localhost',
  'port' => '3306',
  'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' => 'mysql',
);

What I want is to distribute the database connections within an hour to at least 2 usernames so that I avoid my website going down due to exceeding the max_questions limits my hosting has...

Thank you
  •  

Similar topics (2)