728x90
반응형
apt-get update && apt-get install nano vim
이제 conf 설정을 추가해줍니다.
/etc/mysql/my.cnf 에 아래 내용을 추가해줍니다.
#### 1. MySQL 한글 설정 (my.ini)
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
init_connect='SET collation_connection = utf8_general_ci'
character-set-server=utf8
lower_case_table_names=1
[client]
default-character-set = utf8mb4
[mysql]
default-character-set = utf8mb4
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
이제 exit 명령어로 도커를 빠져나와 재실행합니다.
그리고 컨테이너에 접속하고 mysql에 접속하여 아래 명령어로 문자열 인코딩이 변경되었는지 확인합니다.
docker exec -it mysql /bin/bash
mysql -u root -p
status
C:\Users\cbw>docker exec -it mysql /bin/bash
root@bf94afe41d38:/# pwd
/
root@bf94afe41d38:/# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.24 MySQL Community Server - GPL
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> status
--------------
mysql Ver 8.0.24 for Linux on x86_64 (MySQL Community Server - GPL)
Connection id: 9
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 8.0.24 MySQL Community Server - GPL
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: latin1
Conn. characterset: latin1
UNIX socket: /var/run/mysqld/mysqld.sock
Binary data as: Hexadecimal
Uptime: 2 hours 7 min 20 sec
Threads: 3 Questions: 6 Slow queries: 0 Opens: 117 Flush tables: 3 Open tables: 36 Queries per second avg: 0.000
--------------
mysql>
728x90
반응형
'프로그램 > 개발툴 설정' 카테고리의 다른 글
vsCode 개발자 폰트 설정 (0) | 2021.05.10 |
---|---|
Git 최초 설치후 사용법 (0) | 2021.05.10 |
Postgresql 설치 및 셋팅하기 (0) | 2021.05.10 |
Docker 리눅스 서버 vi 설치 (0) | 2021.05.10 |
Mysql docker 설치 (0) | 2021.05.10 |
댓글