Search code examples
phpherokupdocleardb

MySQL's max_questions error is being thrown even for 1 query when the limit is 18000


I've been working on this problem for a few hours now and I'm close to jumping from the Heroku platform purely out of frustration.

I have a simple web app running on Heroku which uses PHP and MySQL with Silex and AngularJS. The MySQL DB (running on ClearDB's service) has two tables: one is empty while the other has one row of data. When the app loads, I use AJAX and try to load the one row of data I have.

This instantly lead to the DB throwing the error:

An exception occurred while executing 'SELECT idcourse_master FROM course_master WHERE stat='1' ORDER BY idcourse_master DESC LIMIT 0,100':

SQLSTATE[42000]: Syntax error or access violation: 1226 User 'ba53d3edafdd3c' has exceeded the 'max_questions' resource (current value: 18000)

It says 18000 now after I upgraded by ClearDB account thinking I probably didn't have enough usage limits to make the app work. But, now that I'm monitoring it and logging to see how many requests are made and queries are executed, I can see that it's literally stopping at the first one.

I googled around and read the solution to the opposite of this problem; people were exceeding the limit. I haven't even run a query yet.

I also assumed I had some code error and decided to connect remotely to the DB from MySQL Workbench. I ran one select statement on the table that has the one row of data and I received the same error.

I'm at my wit's end. Any help would be appreciated! Thanks in advance!


Solution

  • Found the issue. I had a looping issue in one of my queries that was forcing Silex to continuously execute the same query on an empty table. It took me a long time to trace and figure this out.