한글로 입력하니 ??? 이런씩으로 입력이 되어 확인해보니 Mysql 이 character set이 전부 utf-8로 되어있지 않았다.
그래서 utf-8로 설정을 바꾸었다.
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
1./etc/my.cnf 파일 수정
[mysql]
default-character-set = utf8
[mysqld]
character-set-client-handshake=FALSE
init_connect="SET collation_connection = utf8_general_ci"
init_connect="SET NAMES utf8"
character-set-server = utf8
collation-server = utf8_general_ci
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
[client]
default-character-set = utf8
[mysqldump]
default-character-set = utf8
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
sudo service mysqld restart
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 | /usr/share/mysql/charsets/ |
| collation_connection | utf8_general_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_general_ci |
| completion_type | NO_CHAIN |
| concurrent_insert | AUTO |
| connect_timeout | 10 |
+--------------------------+----------------------------+
'Development > Web & Server' 카테고리의 다른 글
[Mysql] errno: 150 발생시!! (0) | 2014.01.03 |
---|---|
[MongoDB] List에 있는 Object의 특정값에 맞는 값 가져오기~! (Spring Data) (0) | 2013.12.31 |
[Spring Framework] Hibernate 4 Search 사용하기~! (Latitude, Longitude 검색) (0) | 2013.12.25 |
[Spring Framework] Hibernate 4 연동하기 (0) | 2013.12.25 |
[Hibernate] Many To One (0) | 2013.12.24 |