리눅스 쉘 MySQL UTF8

1 문제상황[ | ]

[root@zetawiki ~]# mysql -u dbuser -pP@ssw0rd zetadb
... (생략)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select id,worker,state from job;
+----+--------+-------+
| id | worker | state |
+----+--------+-------+
| 17 | ???    | ??    |
| 23 | ???    | ??    |
| 21 | ???    | ??    |
+----+--------+-------+

2 해결방법 1[ | ]

mysql> set names utf8;
Query OK, 0 rows affected (0.00 sec)

mysql> select id,worker,state from job;
+----+--------+-------+
| id | worker | state |
+----+--------+-------+
| 17 | 한놈   | 완료  |
| 23 | 두시기 | 완료  |
| 21 | 석삼   | 취소  |
+----+--------+-------+

3 해결방법 2[ | ]

[root@zetawiki ~]# mysql -u dbuser -pP@ssw0rd zetadb --default-character-set=utf8
... (생략)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select id,worker,state from job;
+----+--------+-------+
| id | worker | state |
+----+--------+-------+
| 17 | 한놈   | 완료  |
| 23 | 두시기 | 완료  |
| 21 | 석삼   | 취소  |
+----+--------+-------+

4 같이 보기[ | ]

5 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}