Ubuntu MySQL 문자셋 지정
Category : Database Comments : 댓글쓰기 Posted by 장창학 at 1:04 AM
Bookmark and Share

Ubuntu는 시슽템의 대부분의 언어셋이 UTF-8임에도 불구하고 APT로 APM를 설치시 Mysql의 기본 인코딩셋은 Latin1입니다. 이를 모든 언어를 지원하는 UTF-8로 변경하려면 my.cnf파일을 다음과 같이 수정합니다. (참고로 기본적으로 Ubuntu Server 설치시 APM을 설치했다면 my.cnf파일의 위치는 /etc/mysql/my.cnf 입니다.)

[client]
default-character-set = utf8

[mysqld]
character-set-client-handshake=FALSE
init_connect="SET collation_connection = utf8_general_ci"
init_connect="SET NAMES utf8"
default-character-set = utf8
character-set-server = utf8
collation-server = utf8_general_ci

[mysqldump]
default-character-set = utf8

[mysql]
default-character-set = utf8


정상적으로 변경되었는지 확인해 보기 위해서는 mysql로 접속하여 다음과 같은 명령어로 확인해 볼 수 있습니다.

\s

Comments


Write your comment



(it will not be displayed - 실제로 댓글 목록에서는 출력되지 않습니다)



Leave this field empty:




About me

Categories

Monthly Archives

Links

Recent Posts

Recent Comments