Wednesday, December 11, 2013

Mysql change time zone in RDS


First login into RDS mysql
then pump this into it

Change the database into your database name
then change the timezone as well

DELIMITER |
    CREATE PROCEDURE mysql.store_time_zone ()
       IF NOT (POSITION('database@' IN CURRENT_USER()) = 1) THEN    
           SET SESSION time_zone = '+8:00';
   END IF
| DELIMITER ;

after done, grant the permission for this

GRANT EXECUTE ON PROCEDURE `mysql`.`store_time_zone` TO 'database'@'172.31.8.2';

then at RDS Dashboard console,
go to Parameter Groups > yours Mysql parameter > edit parameter
search init_connect, then at the edit value put this into it " CALL mysql.store_time_zone "  and save it

No comments:

Post a Comment