'root' has exceeded the 'max_questions' resource (current value: 100) (1226),qtresourceroot

來源:互聯網
上載者:User

'root' has exceeded the 'max_questions' resource (current value: 100) (1226),qtresourceroot


同事遇到一問題

mysqldump: Couldn't execute 'select @@collation_database': User 'root' has exceeded the 'max_questions' resource (current value: 100) (1226)

按照提示很容易想到 max_questions 值太大了,目前只有100,所以報錯。


首先想到show variables like 'r'  居然沒有找到,這個應該不是個全域的參數,那麼在哪兒呢?應該在系統資料表裡。

然後進去的資料庫裡面,想看下多少串連,show full processlist,報一樣的錯誤,任何的select 語句都是報這個錯誤。

幸好只是個開發測試庫,所以直接重啟DB應該可以解決此問題。果不其然,重啟之後一切ok。


進入到mysql庫,查看user表,發現如下欄位

 max_questions          | int(11) unsigned                  | NO   |     | 0       |       

此庫設定的值確實為100,改為0,重新整理許可權。

一般情況下,使用者是不會修改這個值,0的話就是沒有限制,不知道誰手欠,修改了這個值。

按照這樣,應該是針對單個使用者的限制。

解決此問題,應該用別的超級許可權的使用者登入,直接修改這個值,然後重新整理許可權,不重啟db應該也可以解決。

查官方文檔又發現5.6版本新加的欄位password_expired用來控制密碼到期。


看下官方文檔

mysql> GRANT USAGE ON *.* TO 'francis'@'localhost'  WITH MAX_QUERIES_PER_HOUR 100;mysql> GRANT USAGE ON *.* TO 'francis'@'localhost'  WITH MAX_CONNECTIONS_PER_HOUR 0;


The server stores resource limits for an account in the user table row corresponding to the account. The max_questions, max_updates, and max_connections columns store the per-hour limits, and the max_user_connections column stores the MAX_USER_CONNECTIONS limit. 



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.