Syntax error or access violation: 1226 User ‘username’ has exceeded the ‘max_questions’ resource (current value: 75000)

Recently, one of our CMS site receives the following error message:

Syntax error or access violation: 1226 User ‘username’ has exceeded the ‘max_questions’ resource (current value: 75000)
This is clearly an issue with our hosting company. They have setup a MAX limits on the number of queries allowed on the database.

We have spent several hours on the phone with them and they either won’t help us or suggest us to upgrade to a better hosting plan.

Spending some time searching the web, we found a temp solution. It is to create several users in the database. And, then modify our script to call the array of usernames.

e.g.

In the database, we have created 5 usernames with the same password.

In our script, we modify a little so that it grab a random username each time it query the database.

$db_user[] = “user1″;
$db_user[] = “user2″;
$db_user[] = “user3″;
$db_name = $db_user[ rand( 0, ( sizeof($db_user) -1 ) ) ];