The following command helps me to generate a user at the console level in MySQL
CREATE USER 'admin'@'localhost' IDENTIFIED WITH sha256_password BY pass;
With the following command I assign permissions
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost';
and I end with
FLUSH PRIVILEGES;
However, the question is: How to get the system to generate the request for a new password every certain time for a user in MySQL every certain time?
Explanatory note: The encryption plugin sha256_password
that is read in the statement SQL
is available from version 5.6 of MySQL ; here the source
https://dev.mysql.com/doc/refman/5.6/en/sha256-pluggable-authentication.html
At the time that we are generating a user within the MySQL console, we can establish the period within which the manager will ask the created user for a new password
Where, just after indicating the password assigned to the user in question:
PASSWORD EXPIRE INTERVAL
: It will allow me to indicate to the manager that the password is going to be renewed2 DAY
It is an example period where I am indicating that every two days the password will be requested to update when the user in question; in this case admin wants to loginNow, on the contrary, if I want the password associated with a newly created user to never expire; the command should look like this