MYSQL
HOME > DB > MYSQL
2017.03.13 / 14:52

mysql -- character set, collation, utf8 ¼³Á¤

¹Ù¹Ù¸®¾È
Ãßõ ¼ö 352

mysql -- character set, collation, utf8 ¼³Á¤


ȯ°æ : mysql 5.5, ubuntu 14.04 LTS server 64bit


Âü°í : https://dev.mysql.com/doc/refman/5.5/en/charset-general.html

         http://www.mysqlkorea.com/sub.html?mcode=manual&scode=01_1&m_no=22781&cat1=1070&cat2=1071&cat3=0&lang=k

        https://dev.mysql.com/doc/refman/5.5/en/charset-syntax.html

        http://planmaster.tistory.com/449




character set --> a set of symbols and encodings. 

         ; symbol  ¿¹ -- ¾ËÆĺª

         ; encoding ¿¹ -- ¾ËÆĺªÀ» ¼ýÀÚ·Î ³ªÅ¸³½ °Í ( ascii  ÄÚµå¼ýÀÚ)


collation -->  a set of rules for comparing characters in a character set ( ¹®ÀÚºñ±³±ÔÄ¢ )

            ;  _ci (case insensitive), _cs (case sensitive),  _bin (binary)




MySQL can do these things for you:


* Store strings using a variety of character sets. 

 -- ´Ù¾çÇÑ ¹®ÀÚ ¼ÂÀ» »ç¿ëÇؼ­ ½ºÆ®¸µÀ» ÀúÀåÇÑ´Ù.


* Compare strings using a variety of collations.

 -- ´Ù¾çÇÑ ÄÝ·¹¼Ç ±ÔÄ¢À» »ç¿ëÇؼ­ ½ºÆ®¸µÀ» ºñ±³ÇÑ´Ù.


* Mix strings with different character sets or collations in the same server, the same database, or even the same table.

 -- µ¿ÀÏÇÑ ¼­¹ö, µ¿ÀÏ µ¥ÀÌÅÍ º£À̽º, ¶Ç´Â ½ÉÁö¾î µ¿ÀÏ Å×ÀÌºí¿¡¼­ ¼­·Î ´Ù¸¥ ¹®ÀÚ ¼Â ¶Ç´Â ÄÝ·¹¼ÇÀ» »ç¿ëÇؼ­ ½ºÆ®¸µÀ» Á¶ÇÕÇÑ´Ù.


* Enable specification of character set and collation at any level.

 -- ¾î¶² ·¹º§¿¡¼­°Ç ¹®ÀÚ ¼Â°ú ÄÝ·¹¼ÇÀ» ÁöÁ¤ÇÒ ¼ö ÀÖµµ·Ï Çã¿ëÇÑ´Ù.





** There are default settings for character sets and collations at four levels: server, database, table, and column.






<< ¼­¹ö character set, collation ¼³Á¤ º¯°æÇϱâ >>

Âü°í : https://dev.mysql.com/doc/refman/5.5/en/charset-applications.html


-- my.cnf ÆÄÀÏ¿¡ ¾Æ·¡ ³»¿ëÀ» Ãß°¡ÇÏ°í, mysql Àç½ÃÀÛÇϸ頵Ê.


[mysqld]

character-set-server=utf8

collation-server=utf8_general_ci






- º¯°æÀü



- º¯°æÈÄ







<< database »ý¼º½Ã character set, collation ¼³Á¤Çϱâ >>  

Âü°í: https://dev.mysql.com/doc/refman/5.5/en/charset-applications.html


CREATE DATABASE mydb

  DEFAULT CHARACTER SET utf8

  DEFAULT COLLATE utf8_general_ci;