My Sql °ü·Ã ¹®ÀÇ

   Á¶È¸ 8116   Ãßõ 0    

안녕하세요.

 

웹서비스를 중국, 한국 등등할려고 하는데요

 

아래 테이블과 같이 중국어를 insert시킨후
Select 하면 언어가 깨져서 나옵니다.

어떻게 하면 될까요?

 

[root@db ~]# mysql -u find -p find
Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 774
Server version: 5.0.44 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show tables;
+-----------------+
| Tables_in_find  |
+-----------------+
| BASIC_BRANCH    |
| BASIC_CONDITION |
| BASIC_COUNTRY   |
| BASIC_DEPOT     |
| BASIC_FCBRANCH  |
| BASIC_NONISO    |
| BASIC_PORT      |
+-----------------+
7 rows in set (0.00 sec)

mysql> select * from BASIC_COUNTRY;
+-----+---------+----------+---------+-------------------------+----------+---------------------+--------+----------+
| num | ranking | nm_e     | nm_c    | nm_r                    | write_id | write_date          | del_id | del_date |
+-----+---------+----------+---------+-------------------------+----------+---------------------+--------+----------+
|   1 |     100 | korea    | ??댁    | 誤?? ?汝??       | test     | 2010-08-18 16:07:32 |        | NULL     |
|   2 |     100 | ???   | ??댁    | 誤?? ?汝??       | test     | 2010-08-18 16:07:49 |        | NULL     |
|   3 |     100 | ??댁     | ??댁    | ??댁                    | test     | 2010-08-18 18:17:24 |        | NULL     |
+-----+---------+----------+---------+-------------------------+----------+---------------------+--------+----------+
3 rows in set (0.00 sec)

mysql> Aborted
[root@db ~]#

ªÀº±Û Àϼö·Ï ½ÅÁßÇÏ°Ô.
UTF-8 À¯´ÏÄÚµå µîµî mysql°ú ¾ÆÆÄÄ¡ÂÊ È®ÀÎÇغ¸½Ã´Â°Ô...
À̹®Èì 2010-08
1. ¼Ò½º¹öÁ¯À¸·Î ¼³Ä¡Çϼ̴ÂÁö ±×³É ¹ÙÀ̳ʸ®·Î ¼³Ä¡Çϼ̴ÂÁö¸¦ ¾Ë¾Æ¾ß ÇÕ´Ï´Ù.

2. ¹ÙÀ̳ʸ®·Î ¼³Ä¡Çϼ̴ٸé, ´Ù¿î·Îµå ¹ÞÀº ¹ÙÀ̳ʸ®ÀÇ ÄÁÇDZ׷¹À̼ÇÀ» ºÁ¾ß µÇ°í,
¸¸¾à ¼Ò½º¹öÁ¯À¸·Î ¼³Ä¡Çϼ̰í, ÄÁÇDZ׷¹À̼ÇÀ» EUC-KR ¶Ç´Â Áß±¹¾î, ¶Ç´Â UTF-8 Áß Çϳª·Î ÇßÀ» ÅÙµ¥¿ä.
UTF-8ÀÌ °¡Àå ÁÁÀº ¼±ÅÃÀ̶ó°í º¾´Ï´Ù.

3. UTF-8 À̶ó¸é, È­¸é¿¡ Ãâ·Â½Ã¿¡µµ UTF-8 À̶ó´Â »ç½ÇÀ» ¾Ë·Á¾ß ÇÕ´Ï´Ù.

//ÀϹÝÀûÀÎ ¼³Á¤È­ÀÏ À§Ä¡
>vi /etc/my.cnf

¿¡¼­ [client]ºÎºÐ°ú [mysql]ºÎºÐÀ» º¸¸é, ¼³Á¤µÈ ÀÎÄÚµù °ªÀ» È®ÀÎÇÒ ¼ö ÀÖÀ¸½Ç °Ì´Ï´Ù.
¸¸¾à client¿Í mysql ºÎºÐÀÇ ¼³Á¤ÀÌ ´Ù¸£´Ù¸é °°°Ô ¼³Á¤Çϼ¼¿ä.
À̶§ ¾ø´Â ÂÊ¿¡ ÀÌ¹Ì ÀÖ´Â ¼³Á¤À» Ãß°¡ÇϼžßÁö, ±âÁ¸ ¼³Á¤À» ¹«½ÃÇÏ°í, ÀڽŠ¸¶À½´ë·Î ¹Ù²Ù½Ã¸é ¾ÈµË´Ï´Ù.

default-character-set=utf8

ÀÌ·±½ÄÀ¸·Î µÇ¾î ÀÖÀ» °ÍÀÔ´Ï´Ù.

¸µÅ©µµ ³²°ÜµÓ´Ï´Ù.
http://blueb.net/blog/1271
http://dev.mysql.com/doc/refman/5.0/en/charset.html
±èµ¿¼öP 2010-08
1. DBÀÇ DEFAULT CHARSETÀÌ UTF-8 ·Î µÇ¾î ÀÖ´ÂÁö È®ÀÎ
2. ³Ö´ÂÂÊ¿¡¼­ UTF-8 ·Î ³Ö´ÂÁö È®ÀÎ
3. ÄܼÖÀÌ UTF-8·Î µÇ¾îÀÖ´ÂÁö È®ÀÎ ( echo $LANG µîÀ¸·Î ...)

º¸Åë DB°¡ UTF-8ÀÌ ¾Æ´Ï°Å³ª ³Ö´ÂÂÊ¿¡¼­ À߸ø ³Ö°Å³ª, Àß µé¾î°¡ Àִµ¥ º¸´ÂÂÊ¿¡¼­ ±úÁö´Â °æ¿ì°¡ ´ëºÎºÐÀÔ´Ï´Ù.
¹éÂù¿ë 2010-08
¿©·¯ ¸»¾¸ °¨»çµå¸³´Ï´Ù.
ÆùÆ® Á¢¼Ó Ç÷α׷¥ ¹®Á¦¿´½À´Ï´Ù.
¼³¼ºÂù´Ô, À̹®Èì´Ô, ±èµ¿¼ö´Ô ½Å°æ½áÁּż­ °¨»çµå¸³´Ï´Ù.
°¨»çÇÕ´Ï´Ù.


QnA
Á¦¸ñPage 3945/5680
2015-12   1483252   ¹é¸Þ°¡
2014-05   4946584   Á¤ÀºÁØ1
2009-02   4940   ¿ÀÁ¤±Õ
2021-06   2056   º´µû°³´Ô
2009-02   5269   ÀåÁØÈ£
2015-09   4080   ¸Ç¶¥¿¡Çìµù
2023-02   1342   Á¤ÀǼ®
2012-05   5222   °­Àç¿ø
2020-02   2058   saint
2021-06   3756   °ú¾Ï
2023-02   2096   ÇູÇϼ¼
10-29   197   ¹«¾Æ
2015-09   4572   ºô´õ¯
2016-09   4655   ¹Ú»óÀÏ
2012-06   14423   2CPUÃÖÁÖÈñ
2015-09   3678   ¼ÇÇѸÆÁÖ
2023-02   3549   ½ÅÀº¿Ö
2009-03   5326   ÀÌÀç´ö
2015-09   4375   ĸƾ¾Æ¸Þ¸®Ä«³ë
2016-09   4524   ¹Ù¸£Åå
2019-01   3284   pcÄÉÀ̽ºÀÚ¡¦
2021-07   2258   °øµ¹ÀÌ¿¡¿ä