"max_questions" limit not respected when running MySQL query via PHP -
i'm using mysql community server 5.5 php 5.3.3 on windows server 2008 platform. have set per user resources limits, particularly limit related queries run db user within 1 hour. have read document , interesting doesn't work me.
http://dev.mysql.com/doc/refman/5.5/en/user-resources.html
when run query via mysql command line tool (mysql.exe) limit works , if queries limit per hour 7, after 7 queries within 1 hour receive error:
error 1226 (42000): user 'user' has exceeded 'max_questions' resource (current value: 7)
this above wanted behavior.
when run query via php (the user have used connect db same above), queries limit doesn't work: same user via php can run queries wants , without limit. , if come on mysql command line above counter seems reset (even if hour hasn't elapsed) : can run 7 queries within hour too. think isn't wanted behaviour. seems php resets counter , doesn't trigger queries limit.
ps: 'user' owns select,insert,update,delete
privileges , in php code there isn't sql code flush user_resources
user 'user' couldn't have run (because reload
privilege isn't assigned user)
thanks in advance
check tip,
how many users have in mysql same name..(remember not name host permited connect user specified in mysql ). **very important.
user@%
user@127.0.0.1
user@localhost
user@172.35.20.12
each 1 of them not same, if have limit rule use, so, must assign limitations user@wherever want limintation. (all of them, if have problems **think case).
recomendation: create specific user web php (only 1 user@host must created) , instead using generic user may have several users@hosts assigned. phpuser@'localhost' typically enough.
Comments
Post a Comment