Introduction
Occasionally, you will want to lock a MySQL user from utilizing the MySQL databases it is assigned to, or unlock them to give them access again.
Procedure
The MySQL user information is a part of the system-level MySQL database, and can only be modified by root. To login to MySQL as root, do the following:
# mysql
The following command will lock a user that already exists:
ALTER USER 'db_user'@'localhost' ACCOUNT LOCK;
To unlock a user use the following:
ALTER USER 'db_user'@'localhost' ACCOUNT UNLOCK;
Comments
0 comments
Article is closed for comments.