• Resolved masterdune

    (@masterdune)


    When I use the scan function in Wordfence it overloads the mySQL and I get a message ” MySQL said: #1226 – User ” has exceeded the ‘max_questions’ resource (current value: 150000)”

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support wfpeter

    (@wfpeter)

    Hi @masterdune, thanks for your query.

    There are a few ways of changing the max_questions value behind the scenes, but some hosts will naturally restrict your ability to do this. You could ask them to increase the value through their support channels.

    Before asking, I’d try Wordfence > All Options > Basic Scan Type Options and tick the Limited Scan option which will alter a number of settings to reduce the load on your server and database.

    Let me know how you get on!

    Thanks,

    Peter.

    Thread Starter masterdune

    (@masterdune)

    Thank you for your response, I don’t like the idea of having limited detection capability. Would you have an estimate on what my max_questions value needs to be for when I ask my host to increase it or when I get a new host because of this 😛

    Plugin Support wfpeter

    (@wfpeter)

    Hi @masterdune, I like to check if the problem persists under certain conditions in case there’s another plugin over-using your database, but understand that limiting the Wordfence scan long-term may not be ideal for everybody.

    If you are able to access your own database through phpMyAdmin, you could try selecting the WordPress database, accessing the SQL tab, and typing the following (where 0 removes a fixed limit):

    use mysql update user set max_questions = 0 where user = 'YourUsernameHere'; flush privileges;

    If not, we could take a look at your diagnostic report if you could send it to wftest @ wordfence . com. You can find the link to do so at the top of the Wordfence Tools > Diagnostics page. Then click on “Send Report by Email”. Please add your forum username where indicated and respond here after you have sent it.

    Note: For the fastest response time, please make sure and add any information or questions directly to this topic and not the email address above unless asked.

    Thanks again,

    Peter.

    • This reply was modified 5 years, 9 months ago by wfpeter.
    Thread Starter masterdune

    (@masterdune)

    I have sent the report. As for the SQL database.

    SQL query:

    use mysql update user set max_questions = 0 where user = ‘IPlacedMyUsernameHere’

    MySQL said:

    #1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘update user set max_questions = 0 where user = ‘IPlacedMyUsernameHere” at line 1

    Plugin Support wfpeter

    (@wfpeter)

    Hi @masterdune, thanks for letting me know and sending that report over!

    The SQL query looks like it might have invalid quote characters around the username, I can’t be certain if that’s just the way ww.wp.xz.cn are formatting it here, but that would explain a syntax error message. If that wasn’t the issue, it could be possible you aren’t permitted to change that setting.

    Most hosts don’t seem to set max_questions as far as we know, or set it to such a high value that we never reach it, so we don’t see this cropping up particularly often. Wordfence’s scan does make a lot of database queries as it runs, but they’re generally simple/fast ones.

    I can’t give you an exact “ideal” number to set max_questions to as it depends on variables like how many other plugins are running, and how large your site is. Removing old inactive plugins that aren’t being used can make the scan run less queries, which might help, but it may not be enough.

    Try contacting your host to see if they can remove/relax the restriction, and if not, it may be time to find a host that is not affected by the limit.

    Thanks again,

    Peter.

    Thread Starter masterdune

    (@masterdune)

    #1226 – User ” has exceeded the ‘max_questions’ resource (current value: 150000)

    Know idea if that is alot of “questions” but the is how much the best offer at Domain.com will get you.

    Plugin Support wfpeter

    (@wfpeter)

    Hi @masterdune. Is this another case of the same message coming up?

    I appreciate that you may have removed your username from the log, but if it was blank to begin with, this may be a sign that your host has restricted permissions to that particular setting.

    If your username was present in the original message, trying the SQL again with single quotes (‘) instead of backticks (`) could still be effective. This time, try three separate lines in phpMyAdmin rather than one line:

    
    use mysql;
    update user set max_questions = 0 where user = 'YourUsernameHere';
    flush privileges;
    

    We have no recommended setting when it comes to the max_questions number, so hopefully removing the limit or speaking with your host will be able to bring you a resolution.

    Thanks again,

    Peter.

    Thread Starter masterdune

    (@masterdune)

    Yeah,

    MySQL said:
    #1044 – Access denied for user ‘MyUserName’@’10.%’ to database ‘mysql’

    So, I have contacted then to set the max_questions = 0.

    Domain.com = “I can ask our technical specialist to fix this issue”.

    Apparently I need to wait 24-48 hr to receive an update.

    Look like I will need a new host.

    Plugin Support wfpeter

    (@wfpeter)

    @masterdune I hope you find the resolution you need so that switching won’t be necessary.

    If you ever need more assistance with Wordfence in future, please feel free to open a new ticket and we’d be happy to help.

    Thanks,

    Peter.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Too Many Requests’ is closed to new replies.