January 2018
Intermediate to advanced
446 pages
12h 57m
English
If you find any issues with the account, you can lock it. MySQL supports locking while using CREATE USER or ALTER USER.
Lock the account by adding the ACCOUNT LOCK clause to the ALTER USER statement:
mysql> ALTER USER 'developer'@'%' ACCOUNT LOCK;Query OK, 0 rows affected (0.05 sec)
The developer will get an error saying that the account is locked:
shell> mysql -u developer -pnew_company_passmysql: [Warning] Using a password on the command line interface can be insecure.ERROR 3118 (HY000): Access denied for user 'developer'@'localhost'. Account is locked.
You can unlock the account after confirming:
mysql> ALTER USER 'developer'@'%' ACCOUNT UNLOCK;Query OK, 0 rows affected (0.00 sec)
Read now
Unlock full access