일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- proxycfg
- 로그인불가
- pfsense
- miniconda
- Kibana server is not ready yet
- application security
- ELASTIC
- Windows
- freebsd
- centos 8
- hardening
- XCP-ng
- docker
- G-suite
- macos
- endpoint security
- ssh key 배포
- x-pack
- GitLab
- 한글가이드
- Kibana
- 보안양파
- Proxy
- Elasticsearch
- ansible
- bash
- xe guest utilities
- elastic stack
- PlayBook
- Today
- Total
선 밖에 선 자유인
mysql 한글 깨짐 해결 본문
mysql 한글 깨질 때
mysql> status
--------------
mysql Ver 14.14 Distrib 5.1.71, for redhat-linux-gnu (x86_64) using readline 5.1
...
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 14 days 4 hours 31 min 13 sec
Threads: 1 Questions: 82305 Slow queries: 0 Opens: 713 Flush tables: 1 Open tables: 27 Queries per second avg: 0.67
--------------
- mysql charset 변경
/etc/my.cnf 에 아래의 문구 추가
[mysqld]
default-character-set = utf8
[client]
default_character_set=utf8
mysql 재시작 후 확인
mysql> status
--------------
mysql Ver 14.14 Distrib 5.1.71, for redhat-linux-gnu (x86_64) using readline 5.1
...
Server characterset: utf8
Db characterset: latin1
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 1 min 31 sec
Threads: 1 Questions: 50 Slow queries: 0 Opens: 30 Flush tables: 1 Open tables: 23 Queries per second avg: 0.549
--------------
한글 출력 됨
만약 해당 DB의 charset 까지 변경하고 싶으면
mysql> show create database <db_name>;
mysql> alter database <db_name> character set = 'utf8'
mysql> status
--------------
mysql Ver 14.14 Distrib 5.1.71, for redhat-linux-gnu (x86_64) using readline 5.1
...
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8