Setting Account Resource Limits user-limits  option. In this case, if  usera  connects simultaneously from  host1.example.com  and host2.example.com , the server applies the account resource limits separately to each connection. If  usera  connects again from  host1.example.com , the server applies the limits for that connection together with the existing connection from that host. To establish resource limits for an account at account-creation time, use the  CREATE USER  statement. To modify the limits for an existing account, use  ALTER USER . Provide a  WITH  clause that names each resource to be limited. The default value for each limit is zero (no limit). For example, to create a new account that can access the  customer  database, but only in a limited fashion, issue these statements: The limit types need not all be named in the  WITH  clause, but those named can be present in any order. The value for each per-hour limit should be an integer representing a count per hour. For MAX_USER_CONNECTIONS , the limit is an integer representing the maximum number of simultaneous connections by the account. If this limit is set to zero, the global  max_user_connections  system variable value determines the number of simultaneous connections. If  max_user_connections  is also zero, there is no limit for the account. To modify limits for an existing account, use an  ALTER USER  statement. The following statement changes the query limit for  francis  to 100: The statement modifies only the limit value specified and leaves the account otherwise unchanged. To remove a limit, set its value to zero. For example, to remove the limit on how many times per hour francis  can connect, use this statement: As mentioned previously, the simultaneous-connection limit for an account is determined from the MAX_USER_CONNECTIONS  limit and the  max_user_connections  system variable. Suppose that the global  max_user_connections  value is 10 and three accounts have individual resource limits specified as follows: user1  has a connection limit of 10 (the global  max_user_connections  value) because it has a  MAX_USER_CONNECTIONS  limit of zero.  user2  and  user3  have connection limits of 5 and 20, respectively, because they have nonzero  MAX_USER_CONNECTIONS  limits. 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. (See Section 6.2.3, “Grant Tables” .) Resource-use counting takes place when any account has a nonzero limit placed on its use of any of the resources. As the server runs, it counts the number of times each account uses resources. If an account reaches its limit on number of connections within the last hour, the server rejects further connections for the 1273 ALTER USER ’user1’@’localhost’ WITH MAX_USER_CONNECTIONS 0; ALTER USER ’user2’@’localhost’ WITH MAX_USER_CONNECTIONS 5; ALTER USER ’user3’@’localhost’ WITH MAX_USER_CONNECTIONS 20; mysql>  ALTER USER ’francis’@’localhost’ WITH MAX_CONNECTIONS_PER_HOUR 0; mysql>  ALTER USER ’francis’@’localhost’ WITH MAX_QUERIES_PER_HOUR 100; mysql>  CREATE USER ’francis’@’localhost’ IDENTIFIED BY ’frank’ ->  WITH MAX_QUERIES_PER_HOUR 20 ->  MAX_UPDATES_PER_HOUR 10 ->  MAX_CONNECTIONS_PER_HOUR 5 ->  MAX_USER_CONNECTIONS 2;