mysql 한글깨짐 utf-8로 설정하면 해결됨
mysql 에서 status를 입력하면 아래와 같이 나옵니다.
mysql> status
--------------
mysql Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1
Connection id: 122021
Current database: comp_community
Current user: comp_community@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.1.73 Source distribution
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 54 days 1 hour 1 min 4 sec
vi 로 my.cnf 파일을 열어서 characterset을 설정해주면 한글 깨짐 증세를 없앨 수 있습니다.
파일을 열어보면
아주 기본적인것만 되어 있는 것을 볼 수 있습니다.
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
================================================================
위에 추가적으로 설정값을 넣어주면 됩니다.
[mysqld]
CREATE TABLE `comp_tag2` (
`ct_idx` int(11) NOT NULL AUTO_INCREMENT,
`bo_table` varchar(20) NOT NULL DEFAULT '' COMMENT '게시판코드',
`wr_id` int(11) NOT NULL DEFAULT '0' COMMENT '게시판시퀀스',
`ct_tag` varchar(100) NOT NULL DEFAULT '' COMMENT '태그',
`ct_ip` varchar(25) NOT NULL DEFAULT '' COMMENT 'ip',
`ct_regdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`ct_idx`),
KEY `comp_tag2_index1` (`ct_tag`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='태그테이블'
주황색 박스 부분이 추가된 부분입니다.
이렇게 하면 한글깨짐을 없앨 수있습니다.
'Mysql' 카테고리의 다른 글
mysql 프로시저 확인 프로시저스크립트 (1) | 2016.06.24 |
---|---|
mysql 대소문자 구분 (0) | 2016.06.23 |
mysql flush privileges (0) | 2015.11.20 |
mysql 한글깨짐 (0) | 2015.11.08 |
[MySQL] csv 파일을 직접 MySQL 테이블로 Import 하는 방법 (대용량 파일 import 팁) (0) | 2015.10.03 |