Configuring a Password Expiration Policy
Scenarios
Using the same password too long makes it easier for hackers to crack or guess your password. The password security policy limits how long users can use the same password, thereby reducing the risk of brute-force attacks.
You can configure a password expiration policy for your instance in either of the following ways:
- Modify database parameters: MySQL 5.7, 8.0, and 8.4 allow you to set the default_password_lifetime global variable to define the default password expiration period.
- Configure the password expiration policy through DAS: Different password expiration policies can be configured for different users.
Precautions
- Once your password expires, you cannot log in to the database.
- After a password expiration policy is configured, you need to periodically check whether your password is about to expire.
Procedure
- Log in to the RDS console.
- Click
in the upper left corner and select a region. - On the Instances page, click the instance name.
- In the navigation pane, choose Parameters.
- On the displayed page, change the value of default_password_lifetime.
The value of this parameter indicates how many days until a password expires. The default value is 0, indicating that the created user password will never expire.
- Click Save. In the displayed dialog box, click OK.
- Log in to the RDS console.
- Click
in the upper left corner and select a region. - On the Instances page, locate the DB instance and click Log In in the Operation column.
Alternatively, click the DB instance on the Instances page. On the displayed Overview page, click Log In in the upper right corner.
- Enter the username and password and click Log In.
- Choose SQL Operations > SQL Window.
- In the editing area, compile the statement shown below. The unit of password_life_time is day. You are advised to set it to 180.
ALTER USER username PASSWORD EXPIRE INTERVAL password_life_time DAY;
- Click Execute SQL. Then, view SQL execution status on the Executed SQL Statements, Messages, and Result tab pages.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot