World-writable config file '/etc/mysql/conf.d/my.cnf' is ignored.
설정파일의 권한을 755나 044로 바꿔주라는데 구체적인 방법을 모르겠다..
read-only로 만드려고 volumes: - ./mysql/conf.d:/etc/mysql/conf.d:ro
도 해봤는데 해결이 안됐다.
그래서 일단 docker-compose.yml에 설정을 다 적어줬다.
services:
mysql:
container_name: mysql
image: mysql:8.0.29
command:
- --authentication-policy=mysql_native_password // SSL, RSA 사용x
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
- --skip-character-set-client-handshake // 클라이언트의 문자셋을 무시하고 서버쪽 문자셋을 이용
environment:
MYSQL_DATABASE: healthygym
MYSQL_USER: user
MYSQL_PASSWORD: '0000'
MYSQL_ROOT_PASSWORD: '0000'
LANG: C.UTF-8 // 중요
restart: always
ports:
- 3306:3306
volumes:
- ./mysql/init:/docker-entrypoint-initdb.d
networks:
- springboot-mysql-net
설정 확인
docker exec -it mysql bash
mysql -u user -p비밀번호
show variables like "%char%";
show variables like 'collation%';