How do I change the time zone?
In RDS for MySQL, you can change the time zone as follows:
1. Execute the following command to check the current time zone: SELECT @@global.time_zone, @@session.time_zone;.
2. Since the root user does not have the super permissions, you need to go to the Console for parameter settings.
3. Go to Console > Instance Management, select the corresponding instance, and perform parameter settings to query default_time_zone.
The database session is disconnected and reconnected. Execute the command in Step 1 to verify that the time zone has been changed successfully.
How do I configure a password expiration policy in RDS for MySQL?
In MySQL 5.6, you can execute the ALTER USER xxx PASSWORD EXPIRE command to configure the password expiration policy.
In RDS for MySQL 5.7 and 8.0, you can set the global variable default_password_lifetime to control the default expiration time of a user password.
This value of the default_password_life cycle is N, indicating how many days until a password expires. The default value is 0, indicating that the created user password will never expire.
How do I change the transaction isolation level in RDS for MySQL?
In RDS for MySQL, you can change the transaction isolation level as follows:
1. Execute the following command to view the current transaction isolation level: SELECT @@global.tx_isolation;.
2. Since the root user does not have the super permissions, you need to go to the Console for parameter settings.
3. Go to Console > Instance Management, select the corresponding instance, and perform parameter settings to query transaction_isolation (tx_isolation for versions earlier than 5.7.20, which is removed in subsequent versions), and change the transaction isolation level according to your needs.
The database session is disconnected and reconnected. Execute the command in Step 1 to verify that the transaction isolation level has been changed successfully.
How do I ensure that the character sets of RDS for MySQL database are correct?
To ensure that the MySQL database character set is correct, follow the steps below:
Log in to the MySQL instance with the root account.
View the character set.
Execute the following command to view the database character set: show variables like '% character';
Execute the following command to view the database encoding: show variables like 'collation%';
The character set utf8mb4 is used as an example. If the character set viewed in Step 2 is not utf8mb4, execute the following command to change the character set:
Execute the following command to change the database character set: ALTER DATABASE DATABASE_NAME DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
Execute the following command to change the table character set: ALTER TABLE TABLE_NAME DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
Execute the following command to change the character set of all fields in the table: ALTER TABLE TABLE_NAME CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
Use the utf8mb4 character set to store emoji expressions into an RDS for MySQL instance. To store emoji expressions in an RDS for MySQL instance, you need to set the character set to utf8mb4.
When you create a database table, you need to set the character set to utf8mb4 and specify the relevant collation.
How do I use the utf8mb4 character set to store emoji expressions in an RDS for MySQL instance?
To store emoji expressions in an RDS for MySQL instance, you need to set the character set to utf8mb4.
When you create a database table, you need to set the character set to utf8mb4 and specify the relevant collation.
Can I use SQL commands to modify global parameters?
Sorry, RDS for MySQL does not support using the SQL command SET GLOBAL to modify global parameters because the root user does not have the super permissions.
You need to go to Console > Parameter Group or Console > Instance Management > Parameter Setting to modify global parameters. It is expected to open the super permissions to root users in the future. Please keep an eye out for the product trends.
² Note
Exercise with caution when modifying global parameters because it may affect the performance and stability of your MySQL instance. Before modifying the parameter, learn the meaning and roles of the parameters.
How do I set case sensitivity for RDS for MySQL table names?
In RDS for MySQL, the case sensitivity of table name is controlled by the parameter lower_case_table_names.
At present, RDS for MySQL only supports lower_case_table_names=1 (case-insensitive). The case-sensitive function is expected to be launched in the future. Please keep an eye out for product dynamics.