0

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 1

0

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;).

2
  • 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/…
    – Flourid
    Commented Apr 25 at 7:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.