content_image/680525.jpg
external_user@example.com , rather than the proxied user, proxy_user@example.com . Both external_user@example.com  and proxy_user@example.com  must have valid entries in the mysql.user  system table and a proxy relationship between them must be defined in the mysql.proxies_priv  system table (see Section 6.2.18, “Proxy Users” ). 

•If the client user does not proxy another user, but does match a mysql.user  entry, counting uses the CURRENT_USER()  value corresponding to that entry. For example, if a user user1  connecting from a host host1.example.com  matches a user1@host1.example.com  entry, counting uses user1@host1.example.com . If the user matches a user1@%.example.com , user1@%.com , or user1@%  entry instead, counting uses user1@%.example.com , user1@%.com , or user1@% , respectively. 

For the cases just described, the connection attempt matches some mysql.user  entry, and whether the request succeeds or fails depends on whether the client provides the correct authentication credentials. For example, if the client presents an incorrect password, the connection attempt fails. 

If the connection attempt matches no mysql.user  entry, the attempt fails. In this case, no CURRENT_USER()  value is available and connection-failure counting uses the user name provided by the client and the client host as determined by the server. For example, if a client attempts to connect as user user2  from host host2.example.com , the user name part is available in the client request and the server determines the host information. The user/host combination used for counting is user2@host2.example.com . 

## Connection Failure Monitoring 

<img src='content_image/680525.jpg'>

To monitor failed connections, use these information sources: 

## Note 

The server maintains information about which client hosts can possibly connect to the server (essentially the union of host values for mysql.user  entries). If a client attempts to connect from any other host, the server rejects the attempt at an early stage of connection setup: 

ERROR 1130 (HY000): Host ’ host_name ’ is not allowed to connect to this MySQL server 

Because this type of rejection occurs so early, CONNECTION_CONTROL  does not see it, and does not count it. 

•The Connection_control_delay_generated  status variable indicates the number of times the server added a delay to its response to a failed connection attempt. This does not count attempts that occur before reaching the threshold defined by the connection_control_failed_connections_threshold  system variable. 

•The INFORMATION_SCHEMA CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS  table provides information about the current number of consecutive failed connection attempts per account (user/host combination). This counts all failed attempts, regardless of whether they were delayed. 

Assigning a value to connection_control_failed_connections_threshold  at runtime has these effects: 

•All accumulated failed-connection counters are reset to zero. 

•The Connection_control_delay_generated  status variable is reset to zero. 

•The CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS  table becomes empty. 

