2012. 9. 17.

DBMS/MySQL] 4.1.x 에서 Default character set 변경하기...



안녕하세요. 신규로 4.1.7버전의 MySQL 를 설치했는데 character set 의 변경이 잘 되지 않아서 질문 올립니다.
아래에 버전 및 시도해본 방법을 적었습니다. 함 확인해보시고요 해결책 알려주시면 감사하겠습니다~

0. 버전
버전 : 4.1.7, source compile 해서 설치 (my.cnf 에서 수정하려고 configure 할때 character set 설정 하지 않았습니다.)

1. 현재 character 정보
mysql> show variables like 'char%';
+--------------------------+----------------------------------------+
| Variable_name | Value |
+--------------------------+----------------------------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/local/mysql/share/mysql/charsets/ |
+--------------------------+----------------------------------------+

2. 변경하려고 시도해본 방법
1) my.cnf 변경
[mysqld] 아래에
default-character-set=euckr
를 추가하고 mysql을 재시작하면 에러가 납니다.
/mysql/var/***.err 에서 에러를 확인하면 아래와 같습니다.
/usr/local/mysql/libexec/mysqld: Character set 'euckr' is not a compiled character set and is not specified in the '/usr/local/mysql/share/mysql/charsets/Index.xml' file

"Character set 'euckr' is not a compiled character set" 이라면 compile할때 euckr 이 빠졌다는 것인가요?
'/usr/local/mysql/share/mysql/charsets/Index.xml' file 에는 euckr 항목이 있습니다.

<charset name="euckr">
<family>Korean</family>
<description>EUC-KR Korean</description>
<alias>euc_kr</alias>
<alias>euc-kr</alias>
<collation name="euckr_korean_ci" id="19" order="Korean">
<flag>primary</flag>
<flag>compiled</flag>
</collation>
<collation name="euckr_bin" id="85">
<flag>binary</flag>
<flag>compiled</flag>
</collation>
</charset>

2) database의 character set을 직접 변경
mysql> ALTER DATABASE tv DEFAULT CHARACTER SET euckr;
ERROR 1115 (42000): Unknown character set: 'euckr'

3) 지원하는 character set 확인
설치한 mysql 서버에서 지원하는 character set을 확인해 보았습니다만 euckr 이 없네요.
mysql> SHOW CHARACTER SET;
+----------+-----------------------------+---------------------+--------+
Charset | Description | Default collation | Maxlen |
+----------+-----------------------------+---------------------+--------+
| dec8 | DEC West European | dec8_swedish_ci | 1 |
| cp850 | DOS West European | cp850_general_ci | 1 |
| hp8 | HP West European | hp8_english_ci | 1 |
| koi8r | KOI8-R Relcom Russian | koi8r_general_ci | 1 |
| latin1 | ISO 8859-1 West European | latin1_swedish_ci | 1 |
| latin2 | ISO 8859-2 Central European | latin2_general_ci | 1 |
| swe7 | 7bit Swedish | swe7_swedish_ci | 1 |
| ascii | US ASCII | ascii_general_ci | 1 |
| hebrew | ISO 8859-8 Hebrew | hebrew_general_ci | 1 |
| koi8u | KOI8-U Ukrainian | koi8u_general_ci | 1 |
| greek | ISO 8859-7 Greek | greek_general_ci | 1 |
| cp1250 | Windows Central European | cp1250_general_ci | 1 |
| latin5 | ISO 8859-9 Turkish | latin5_turkish_ci | 1 |
| armscii8 | ARMSCII-8 Armenian | armscii8_general_ci | 1 |
| utf8 | UTF-8 Unicode | utf8_general_ci | 3 |
| cp866 | DOS Russian | cp866_general_ci | 1 |
| keybcs2 | DOS Kamenicky Czech-Slovak | keybcs2_general_ci | 1 |
| macce | Mac Central European | macce_general_ci | 1 |
| macroman | Mac West European | macroman_general_ci | 1 |
| cp852 | DOS Central European | cp852_general_ci | 1 |
| latin7 | ISO 8859-13 Baltic | latin7_general_ci | 1 |
| cp1251 | Windows Cyrillic | cp1251_general_ci | 1 |
| cp1256 | Windows Arabic | cp1256_general_ci | 1 |
| cp1257 | Windows Baltic | cp1257_general_ci | 1 |
| binary | Binary pseudo charset | binary | 1 |
| geostd8 | GEOSTD8 Georgian | geostd8_general_ci | 1 |
+----------+-----------------------------+---------------------+--------+

1)의 에러메시지에서 처럼 euckr character set 이 compile 되지 않았다는 것 같은데요,
그럼 어떻게 추가할수 있을까요.

댓글 없음:

댓글 쓰기