¿ù°£ Àα⠰Խù°

°Ô½Ã¹° 58°Ç
   
[MYSQL] Named timezone ¼³Á¤
±Û¾´ÀÌ : ÃÖ°í°ü¸®ÀÚ ³¯Â¥ : 2015-10-20 (È­) 11:29 Á¶È¸ : 4966
±ÛÁÖ¼Ò :
                          

:: È®ÀÎ
MariaDB [(none)]> select count(*) from mysql.time_zone;
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (0.00 sec)

:: ¼³Á¤ 
mysql ¿¡¼­ Á¦°øÇÏ´Â utility_queryÀÎ mysql_tzinfo_to_sqlÀ» ÀÌ¿ëÇؼ­ µ¥ÀÌŸ µî·Ï
# mysql_tzinfo_to_sql /usr/share/zoneinfo |mysql -uroot -pghtmxldrltnfwldnjs23 mysql

MariaDB [(none)]> select count(*) from mysql.time_zone;
+----------+
| count(*) |
+----------+
|     1787 |
+----------+
1 row in set (0.00 sec)

MariaDB [(none)]> 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';
+------------------+--------------+
| name             | time_zone_id |
+------------------+--------------+
| Asia/Seoul       |          303 |
| posix/Asia/Seoul |          899 |
| right/Asia/Seoul |         1495 |
+------------------+--------------+
3 rows in set (0.00 sec)




MariaDB [nova]> select @system_time_zone;
+-------------------+
| @system_time_zone |
+-------------------+
| NULL              |
+-------------------+
1 row in set (0.02 sec)

MariaDB [nova]> select @@global.time_zone, @@session.time_zone;
+--------------------+---------------------+
| @@global.time_zone | @@session.time_zone |
+--------------------+---------------------+
| SYSTEM             | SYSTEM              |
+--------------------+---------------------+
1 row in set (0.03 sec)

MariaDB [(none)]> set time_zone = 'Asia/Seoul';
Query OK, 0 rows affected (0.02 sec)

MariaDB [(none)]>  select @@time_zone;
+-------------+
| @@time_zone |
+-------------+
| Asia/Seoul  |
+-------------+
1 row in set (0.00 sec)

MariaDB [(none)]> select @@global.time_zone, @@session.time_zone;
+--------------------+---------------------+
| @@global.time_zone | @@session.time_zone |
+--------------------+---------------------+
| SYSTEM             | Asia/Seoul          |
+--------------------+---------------------+
1 row in set (0.00 sec)

MariaDB [(none)]>  select @@system_time_zone;
+--------------------+
| @@system_time_zone |
+--------------------+
| KST                |
+--------------------+
1 row in set (0.00 sec)


À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

 



 
»çÀÌÆ®¸í : ¸ðÁö¸®³× | ´ëÇ¥ : ÀÌ°æÇö | °³ÀÎÄ¿¹Â´ÏƼ : ·©Å°´åÄÄ ¿î¿µÃ¼Á¦(OS) | °æ±âµµ ¼º³²½Ã ºÐ´ç±¸ | ÀüÀÚ¿ìÆí : mojily°ñ¹ðÀÌchonnom.com Copyright ¨Ï www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.