본문 바로가기

Mac/Software

Mac 에서 MySQL character set 설정하기.

Mac 의 MySQL 에서 character 확인하기.

mysql> \s
--------------
./usr/local/mysql/bin/mysql  Ver 14.14 Distrib 5.1.47, for apple-darwin10.3.0 (i386) using readline 5.1

Connection id:        4
Current database:   
Current user:        johnkim@localhost
SSL:            Not in use
Current pager:        stdout
Using outfile:        ''
Using delimiter:    ;
Server version:        5.1.47 MySQL Community Server (GPL)
Protocol version:    10
Connection:        Localhost via UNIX socket
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    latin1
Conn.  characterset:    latin1
UNIX socket:        /tmp/mysql.sock
Uptime:            1 hour 33 sec

Threads: 1  Questions: 50  Slow queries: 0  Opens: 19  Flush tables: 1  Open tables: 12  Queries per second avg: 0.13


------------------------------

mysql> SET character_set_client = utf8;
mysql> SET character_set_results = utf8;
mysql> SET character_set_connection = utf8;
mysql> ALTER DATABASE [DB명] DEFAULT CHARACTER SET utf8;
commit;