questions resource (current value: 100) (1226)

同事遇到一问题

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.

懂得倾听别人的忠告。

questions resource (current value: 100) (1226)

相关文章:

你感兴趣的文章:

标签云: