[mysql] 한글입력 안될때 방법

mysql 사용중에 한글 입력이 안될때가 있다.
해결방법은 간단하다.

※characterset 확인방법
show variables like ‘char%’; 또는
\s

C:\Program Files\MySQL\MySQL Server 5.5\my.ini를 연다.

[mysql]

default-character-set=euckr
# SERVER SECTION
# ———————————————————————-
#
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this
# file.
#
[mysqld]

# The TCP/IP Port the MySQL Server will listen on
port=3306
#Path to installation directory. All paths are usually resolved relative to this.
basedir=”C:/Program Files/MySQL/MySQL Server 5.5/”

#Path to the database root
datadir=”C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.5/Data/”

# The default character set that will be used when a new schema or table is
# created and no character set is defined
character-set-server=euckr

utf8로 되어있는 부분을 euckr로 변경하고 sql을 재시작하면 적용된다.

일시적인 방법도 있다. (재접속을 하면 적용되지 않는다.)

[현재 characterset 설정 확인]
mysql> show variables like ‘char%’;

[client characterset 변경]
mysql> set names [변경하고자 하는 characterset 명칭];

[database characterset 변경]
mysql> alter database [DB명칭] character set [변경하고자 하는 characterset 명칭];

Be the first to comment

Leave a Reply

Your email address will not be published.


*