时间:2021-07-01 10:21:17 帮助过:19人阅读
You can change the time zone on each connection or session by making a procedure in default mysql database and call this function on each init connection.
1. Create a procedure for IST
DELIMITER | CREATEPROCEDURE mysql.rds_store_time_zone ()IFNOT(POSITION('rdsadmin@'INCURRENT_USER())=1)THEN SET SESSION time_zone ='+5:30';ENDIF|DELIMITER ;
2. Update parameter group
aws rds modify-db-parameter-group --db-parameter-group-name parameter_group_name --parameters "ParameterName=init_connect, ParameterValue=CALL mysql.rds_store_time_zone, ApplyMethod=immediate"
3. Grant execute permission
GRANT EXECUTE ON PROCEDURE mysql.rds_store_time_zone TO 'user'@'%';