MySQLで「max_questions」リソース値を変更する方法
多くの場合、次のエラーが発生します。 これはMySQLリソースモニター機能によるもので、「max_questions」は「ユーザーが1時間以内に実行できるクエリの数」を意味します。
ここでは、MySQLの「max_questions」値を更新または変更する方法を示します。
1)MySQLコンソールにログインします。私はrootです〜
example@myserver:~# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1640 Server version: 5.0.32-Debian_7etch10-log Debian etch distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql>
2)mysqlデータベースに切り替えます。
mysql> use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql>
3)MySQLユーザーのテーブルからユーザー情報を取得します。
mysql> select user, max_questions from user; +------------------+---------------+ | user | max_questions | +------------------+---------------+ | root | 0 | | root | 0 | | debian-sys-maint | 0 | | root | 0 | | example | 1000 | +------------------+---------------+ 5 rows in set (0.00 sec) mysql>
3)max_question値を更新します。0は無制限を意味します
mysql> update user set max_questions = 0 where user = 'example'; Query OK, 0 rows affected (0.00 sec) Rows matched: 1 Changed: 0 Warnings: 0 mysql>
4)権限をフラッシュして、変更を有効にします。
mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql>
5)完了。 ユーザーの例では、データベースへの無制限のクエリアクセスがあります。 :)