title: "max_questions" limit not respected when running MySQL query via PHP
body: <p>I'm using MySQL Community Server 5.5 with PHP 5.3.3 on a Windows Server 2008 platform.
  I have set up per user resources limits, particularly a limit related to the queries run by a DB user within one hour. I have read this document and it is very interesting but always it doesn't work for me.</p>
  
  <p><a href="http://dev.mysql.com/doc/refman/5.5/en/user-resources.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.5/en/user-resources.html</a></p>
  
  <p>When I run a query via mysql command line tool (mysql.exe) the limit works properly and if the queries limit per hour was 7, after 7 queries within one hour I receive the error:</p>
  
  <blockquote>
    <p>ERROR 1226 (42000): User 'user' has
    exceeded the 'max_questions' resource
    (current value: 7)</p>
  </blockquote>
  
  <p>This above is the wanted behavior.</p>
  
  <p>When I run a query via PHP (The user I have used to connect to the DB is the same above), the queries limit doesn't work: the same user via php can run all the queries it wants and without any limit. And if I come back on the mysql command line above the counter seems to be reset (even if the hour hasn't elapsed) : I can run 7 queries within an hour too.
  I think this isn't the wanted behaviour. It seems that PHP resets the counter and doesn't trigger the queries limit.</p>
  
  <p>PS: The 'user' owns only <code>SELECT,INSERT,UPDATE,DELETE</code> privileges and in the PHP code there isn't any SQL code as <code>FLUSH USER_RESOURCES</code> that the user 'user' couldn't have run (because <code>RELOAD</code> privilege isn't assigned to the user)</p>
  
  <p>Thanks in advance</p>