mysql -- character set, collation, utf8 ¼³Á¤
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
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;