- I use root to log in on local MySQL Server Machine 192.168.156.33 and create new user test for anonymous host %
CREATE USER test IDENTIFIED BY 'password';
- I use client machine to log in with user test
mysql -u test -h 192.168.156.33 -p
- I use server machine again to set test password account to expire by using
ALTER USER 'test'@'%' PASSWORD EXPIRE;
and useFLUSH PRIVILEGES;
Notice that user test still log in on client machine - User test in client machine still can use command:
SHOW DATABASES, USE, SELECT,...
without show warning to change password - After I use command
\r
or (exit
and log in back), and try to use command, it show warning to change password like normal
What I want is: How to stop user from use commands when set password to expire and show warning to them to change password without reconnect to server?