본문 바로가기
Database/MySQL

Mysql 환경설정 - 다국어 개발환경(utf-8)일 경우

by wansdream 2009. 1. 20.
Mysql 환경설정 - 다국어 개발환경(utf-8)일 경우

 window -> C:\Windows 밑에 my.ini 파일에 추가
 ubuntu -> /etc/mysql/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"
default-character-set = utf8
character-set-server = utf8
collation-server = utf8_general_ci

[client]
default-character-set = utf8

[mysqldump]
default-character-set = utf8
Mysql Restart


root 계정으로 mysql 접속후
mysql>status
아래와 같이 나오면 설정 OK.

mysql> status
--------------
mysql  Ver 14.12 Distrib 5.0.37, for Win32 (ia32)
Connection id:          1
Current database:
Current user:           root@localhost
SSL:                    Not in use
Using delimiter:        ;
Server version:         5.0.37-community MySQL Community Edition (GPL)
Protocol version:       10
Connection:             localhost via TCP/IP
Server characterset:    utf8
Db     characterset:    utf8
Client characterset:    utf8
Conn.  characterset:    utf8
TCP port:               3306
Uptime:                 10 sec
Threads: 1  Questions: 4  Slow queries: 0  Opens: 12  Flush tables: 1  Open tabl
es: 6  Queries per second avg: 0.400   
--------------
mysql>

댓글