맨티스 charset 설치

web 2009. 8. 8. 01:27


기존 사용하고 있는 db가 mssql이라 맨티스를 붙여보려고 삽질하다가..
기본 db가 mysql이라 잘 안붙나보다 하고 mysql설치하고 하루 종일 삽질...

일단 정확한 오류를 보기 위해서 맨티스의 기본 언어를 english로 설정한다.
그냥 아무 설정 변경없이 맨티스를 mysql에 설치하고 계정을 추가할 때
한글이름을 넣고 추가하면 다음과 같은 에러가 발생한다.

APPLICATION ERROR #401
Database query failed. Error received from database was #1267: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' for the query: SELECT id
FROM mantis_user_table
WHERE username='한글명'.

맨티스의 기본 언어가 korean으로 되어 있다면 db가 알려주는 세부 에러메세지를
표시하지 않는다. 문제의 원인은 에러메세지에 표시되어 있다.
db의 문자셋은 latin1_swedish_ci인데 utf8_general_ci문자셋으로 저장하려고 하니 안되는 거다.
우선 테이블 생성부터 다시 해야한다. 기존에 데이터가 있는 경우라면 테이블을 일일이 수정해야겠지만
나는 공db라 그냥 다시 생성했다. 블로그 어딘가에서 일괄적으로 변경해주는 스크립트를 본 것같다.

맨티스의 테이블 스크립를 담당하는 파일(.\admin\schma.php)을 수정한다.
'TYPE=MyISAM'을 모조리 'TYPE=MyISAM DEFAULT CHARSET=utf8'로 찾아바꾸기 한다.

주절 주절 떠들었지만... 이게 다다. -_-

다른 곳에서는

mysql> show variables like 'c%';
+--------------------------+--------------------------+
| Variable_name            | Value                    |
+--------------------------+--------------------------+
| character_set_client     | latin1                   |
| character_set_connection | latin1                   |
| character_set_database   | utf8                     |
| character_set_filesystem | binary                   |
| character_set_results    | latin1                   |
| character_set_server     | latin1                   |
| character_set_system     | utf8                     |
| character_sets_dir       | C:\mysql\share\charsets\ |
| collation_connection     | latin1_swedish_ci        |
| collation_database       | utf8_general_ci          |
| collation_server         | latin1_swedish_ci        |
| completion_type          | 0                        |
| concurrent_insert        | 1                        |
| connect_timeout          | 10                       |
+--------------------------+--------------------------+
14 rows in set (0.00 sec)

위에 표시되는 항목들을 원하는 문자셋으로 맞추는 것에 대해 많이 얘기를
하고 있는데.. 도움이 될 경우도 있을 것같아 적는다..
위에서 보이는 모든 항목을 utf8로 맞추려면 다음 두가지 명령이면 된다.
mysql> set names utf8;
Query OK, 0 rows affected (0.00 sec)
mysql> set session character_set_server=utf8;
Query OK, 0 rows affected (0.00 sec)

mysql> show variables like 'c%';
+--------------------------+--------------------------+
| Variable_name            | Value                    |
+--------------------------+--------------------------+
| character_set_client     | utf8                     |
| character_set_connection | utf8                     |
| character_set_database   | utf8                     |
| character_set_filesystem | binary                   |
| character_set_results    | utf8                     |
| character_set_server     | utf8                     |
| character_set_system     | utf8                     |
| character_sets_dir       | C:\mysql\share\charsets\ |
| collation_connection     | utf8_general_ci          |
| collation_database       | utf8_general_ci          |
| collation_server         | utf8_general_ci          |
| completion_type          | 0                        |
| concurrent_insert        | 1                        |
| connect_timeout          | 10                       |
+--------------------------+--------------------------+
14 rows in set (0.00 sec)

 다음은 config_defaults_inc.php에서 수정한 항목들..

 $g_default_language  = 'korean';

 $g_administrator_email = '메일주소';
 $g_webmaster_email  = '메일주소';
 $g_from_email   = '메일주소';
 $g_return_path_email = '메일주소';

 $g_phpMailer_method  = 2;
 $g_smtp_host   = '공인IP';

 $g_file_upload_method = DISK;
 $g_absolute_path_default_upload_folder = 'E:/mantis/upload/';

 $g_show_realname = ON;

블로그 이미지

란마12

,