I have this set of user accounts that I desire to create with default passwords then force the users to change passwords at first login. Plus, I wanted to force all user accounts to be resetting passwords after every 90 days. Is this supported in MySQL 5.7.x?
1 Answer
All your questions are answered in this documentation.
To force a user to reset his password use ALTER USER 'user'@'host' PASSWORD EXPIRE;
.
To force an expiration date of 90 days, either use ALTER USER 'user'@'host' PASSWORD EXPIRE INTERVAL 90 DAY;
for a single user, or set the variable default_password_lifetime
to 90 for all users (you can exclude certain users by issuing a ALTER USER 'user'@'host' PASSWORD EXPIRE NEVER;
).
-
For my use case, the target audience uses data analytics tools to connect to MySQL. Is there some sort of open source tool that can handle the prompt for password reset etc. without having to use the command shell? Commented Apr 24 at 3:10
-
Every tool can implement the feature as described here: dev.mysql.com/doc/refman/8.0/en/expired-password-handling.html Your best bet is probably MySQL Workbench, as this is an official tool. You might also want to look into the following server variable: dev.mysql.com/doc/refman/8.0/en/…– FlouridCommented Apr 25 at 7:08