Setting Account Resource Limits As of MySQL 8.0.19,  ALTER USER ... UNLOCK  unlocks any account named by the statement that is temporarily locked due to too many failed logins. See Section 6.2.15, “Password Management” . Account locking state is recorded in the  account_locked  column of the  mysql.user  system table. The output from  SHOW CREATE USER  indicates whether an account is locked or unlocked. If a client attempts to connect to a locked account, the attempt fails. The server increments the Locked_connects  status variable that indicates the number of attempts to connect to a locked account, returns an  ER_ACCOUNT_HAS_BEEN_LOCKED  error, and writes a message to the error log: Locking an account does not affect being able to connect using a proxy user that assumes the identity of the locked account. It also does not affect the ability to execute stored programs or views that have a  DEFINER  attribute naming the locked account. That is, the ability to use a proxied account or stored programs or views is not affected by locking the account. The account-locking capability depends on the presence of the  account_locked  column in the mysql.user  system table. For upgrades from MySQL versions older than 5.7.6, perform the MySQL upgrade procedure to ensure that this column exists. See Section 2.11, “Upgrading MySQL” . For nonupgraded installations that have no  account_locked  column, the server treats all accounts as unlocked, and using the  ACCOUNT LOCK  or  ACCOUNT UNLOCK  clauses produces an error. One means of restricting client use of MySQL server resources is to set the global max_user_connections  system variable to a nonzero value. This limits the number of simultaneous connections that can be made by any given account, but places no limits on what a client can do once connected. In addition, setting  max_user_connections  does not enable management of individual accounts. Both types of control are of interest to MySQL administrators. To address such concerns, MySQL permits limits for individual accounts on use of these server resources: Any statement that a client can issue counts against the query limit. Only statements that modify databases or tables count against the update limit. An “account”  in this context corresponds to a row in the  mysql.user  system table. That is, a connection is assessed against the  User  and  Host  values in the  user  table row that applies to the connection. For example, an account  ’usera’@’%.example.com’  corresponds to a row in the  user  table that has User  and  Host  values of  usera  and  %.example.com , to permit  usera  to connect from any host in the  example.com  domain. In this case, the server applies resource limits in this row collectively to all connections by  usera  from any host in the  example.com  domain because all such connections use the same account. Before MySQL 5.0, an “account”  was assessed against the actual host from which a user connects. This older method of accounting may be selected by starting the server with the  --old-style- •The number of queries an account can issue per hour •The number of updates an account can issue per hour •The number of times an account can connect to the server per hour •The number of simultaneous connections to the server by an account 1272 6.2.20 Setting Account Resource Limits Access denied for user ’ user_name ’@’ host_name ’. Account is locked.