Mac mysql 한글 깨짐 현상 해결.
sudo vi /usr/local/mysql/my.cnf
하단에 아래의 내요을 추가 한다.
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
# socket = .....
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
#-- 내요추가 시작 --
[mysql]
default-character-set = utf8
[client]
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
[mysqldump]
default-character-set = utf8
#-- 내요추가 끝 --
종료 후 서버를 재시작..
> /usr/local/mysql/bin/mysql -uroot -p
mysql 접속후 status를 입력하여 utf8롤 설정되어있는지 확인한다.
mysql> status
--------------
/usr/local/mysql/bin/mysql Ver 14.14 Distrib 5.6.13, for osx10.7 (x86_64) using EditLine wrapper
Connection id: 11
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.6.13 MySQL Community Server (GPL)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /tmp/mysql.sock
Uptime: 21 min 47 sec
Threads: 9 Questions: 405 Slow queries: 0 Opens: 132 Flush tables: 1 Open tables: 125 Queries per second avg: 0.309
--------------