sa_get_user_status system procedure

Allows you to determine the current status of users.

Syntax
sa_get_user_status
Arguments

None

Result set
Column name Data type Description
user_id UNSIGNED INT A unique number identifying the user.
user_name CHAR(128) The name of the user.
connections INT The current number of connections by this user.
failed_logins UNSIGNED INT The number of failed login attempts made by the user.
last_login_time TIMESTAMP The time the user last logged in.
locked TINYINT Indicates if the user account is locked.
reason_locked LONG VARCHAR(255) The reason the account is locked.
Remarks

This procedure returns a result set that shows the current status of users. In addition to basic user information, the procedure includes a column indicating if the user has been locked out and a column with a reason for the lockout. Users can be locked out for the following reasons: locked due to policy, password expiry, or too many failed attempts.

Permissions

DBA authority required to view information about all users. Users without DBA authority can only view their own information.

Side effects

None

See also
Example

The following example uses the sa_get_user_status system procedure to return the status of database users.

CALL sa_get_user_status;