Hands-on Lab·MySQL
MySQL Account Locking, Revocation and Removal
Locking an account is reversible and keeps its grants; dropping it is neither. `ERROR 3118` is what a locked account looks like from outside, and it is distinct from a wrong password.
Users and Privileges Guide 20 of 45 Intermediate
- OSUbuntu 26.04 LTS (resolute)
- MySQL8.4.10-0ubuntu0.26.04.1
- Authcaching_sha2_password
- TimeAbout 13 min
- Reviewed27 August 2026
Written against the versions above. `ACCOUNT LOCK` is 5.7.6+. Before that, offboarding meant dropping the account or changing its password, both of which lose information.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| db-a01 | 192.168.0.81 | Ubuntu 26.04 LTS | Primary / Source / Replica Set Member 1 | 2 Core | 4 GB | 50 GB |
Before you start
- The
supportandreportingaccounts from earlier in this track.
-
Lock an account without destroying anything
-
See what a locked account looks like from outside
-
Unlock it
-
Revoke a privilege and watch USAGE remain
-
Drop the account for good