ChangeMySQLTimezoneonAmazonRDS_MySQL
來源:懂視網(wǎng)
責(zé)編:小采
時(shí)間:2020-11-09 19:21:21
ChangeMySQLTimezoneonAmazonRDS_MySQL
ChangeMySQLTimezoneonAmazonRDS_MySQL:Amazon RDS doesnt allow you to change timezone, It keeps same UTC time zone across all regions. time_zonevariable in the parameter group is read only.You can change the time zone
導(dǎo)讀ChangeMySQLTimezoneonAmazonRDS_MySQL:Amazon RDS doesnt allow you to change timezone, It keeps same UTC time zone across all regions. time_zonevariable in the parameter group is read only.You can change the time zone
Amazon RDS doesn’t allow you to change timezone, It keeps same UTC time zone across all regions. time_zonevariable in the parameter group is read only.
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'@'%';
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
ChangeMySQLTimezoneonAmazonRDS_MySQL
ChangeMySQLTimezoneonAmazonRDS_MySQL:Amazon RDS doesnt allow you to change timezone, It keeps same UTC time zone across all regions. time_zonevariable in the parameter group is read only.You can change the time zone