【问题标题】:User 'root' has exceeded the 'max_questions' resource用户“root”已超出“max_questions”资源
【发布时间】:2020-06-15 10:38:41
【问题描述】:

我收到此错误:

ERROR 1226 (42000): User 'root' has exceeded the 'max_questions' resource (current value: 4)

由于这个错误,我什至无法更改数据库中的值。有什么想法吗?

【问题讨论】:

    标签: mysql database database-connection


    【解决方案1】:

    更改 root 用户属性,例如-

    GRANT USAGE ON *.* TO 'root'@<'host_name'> WITH MAX_QUERIES_PER_HOUR 100
    

    设置 0 以重置限制。

    【讨论】:

    • 谢谢,但执行您提到的命令后我仍然收到此错误:ERROR 1226 (42000): User 'root' has exceeded the 'max_questions' resource (current value: 4)
    • 您必须重新连接。然后检查应用的更改,运行SHOW GRANTS
    • 非常感谢德瓦特。像魅力一样工作。
    • 更改属性的位置。我在共享服务器上并遇到同样的错误
    • 执行命令后出现此错误Error Code: 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 'MAX_QUERIES_PER_HOUR 100' at line 1
    【解决方案2】:

    简单的解决方法:

    User 'root' has exceeded the 'max_questions' resource (current value: 100)
    

    要解决问题,您必须等待 1 小时才能运行这些命令中的任何一个。因为问题是,最大问题设置为每小时一定数量的请求。如果您尝试在 1 小时结束之前运行这些命令,这些命令将不起作用。所以等 1 小时..

    1 小时过去后,在终端中按确切顺序运行以下命令:

    * mysql -u root -p
    
    * use mysql
    
    * select user, max_questions from user; 
    
    * update user set max_questions = 0 where user = 'root';
    
    * flush privileges;
    
    * select user, max_questions from user; 
    
    

    (如果 root max questions 显示为“0”,那么你已经修复了它。现在你已经完成了)

    【讨论】:

      猜你喜欢
      • 2015-10-23
      • 1970-01-01
      • 1970-01-01
      • 2021-05-31
      • 2017-01-02
      • 2021-12-25
      • 1970-01-01
      • 2018-05-12
      • 1970-01-01
      相关资源
      最近更新 更多