Skip to main content
2 of 6
added 1175 characters in body
RolandoMySQLDBA
  • 184.3k
  • 33
  • 323
  • 531

You can set this per-user.

Under the WITH option for the MySQL GRANT command yu gave the following:

with_option:
    GRANT OPTION
  | MAX_QUERIES_PER_HOUR count
  | MAX_UPDATES_PER_HOUR count
  | MAX_CONNECTIONS_PER_HOUR count
  | MAX_USER_CONNECTIONS count

You can set

  • queries per hour
  • updates per hour
  • inserts per hour
  • connection per hour

This can give you finer per-hour granularity not only in terms of the number of connections made, but what can be executed.

The columns for these user grants are locate in mysql.user:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.29 MySQL Community Server (GPL)

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select column_name from information_schema.columns
    -> where table_schema='mysql'
    -> and table_name='user'
    -> and column_name like 'max%'
    -> order by ordinal_position;
+----------------------+
| column_name          |
+----------------------+
| max_questions        |
| max_updates          |
| max_connections      |
| max_user_connections |
+----------------------+
4 rows in set (0.01 sec)

mysql>

I wrote about these things before

RolandoMySQLDBA
  • 184.3k
  • 33
  • 323
  • 531