막무가내 삽질 블로그
MySQL 한국시간 설정 본문
728x90
접속
mysql -u 아이디 -p
현재시간확인
select now();
순서대로 진행
select b.name,a.time_zone_id
from mysql.time_zone a, mysql.time_zone_name b
where a.time_zone_id = b.time_zone_id
and b.name like '%Seoul';
select count(*) from mysql.time_zone;
select @@system_time_zone;
quit;
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
패스워드 입력
mysql -u userid -p
select @@global.time_zone,@@session.time_zone,@@system_time_zone;
set time_zone='Asia/Seoul';
select now();
select @@global.time_zone,@@session.time_zone,@@system_time_zone;
systemctl restart mysql
mysql -u userid -p
select @@global.time_zone,@@session.time_zone,@@system_time_zone;
select b.name,a.time_zone_id
from mysql.time_zone a, mysql.time_zone_name b
where a.time_zone_id = b.time_zone_id
and b.name like '%Seoul';
Comments