본문 바로가기

개발일지

[오류 해결] [Docker][MySQL] Access denied for user 'root'@'172.17.0.1' (using password: YES)

728x90

Docker에 Mysql을 설치하고 웹프로젝트 실행하였는데 접속 오류가 발생하였습니다.

Cannot create PoolableConnectionFactory (Access denied for user 'root'@'172.17.0.1' (using password: YES)

그래서 해결을 하려고 찾아보니 아래 사이트를 보고 해결합니다.

medium.com/tech-learn-share/docker-mysql-access-denied-for-user-172-17-0-1-using-password-yes-c5eadad582d3

 

[Docker][MySQL]Access denied for user ‘’@’172.17.0.1'(using password: YES)

Problem: Using $ mysql or mysql-workbench or navicat15 or SQLPro for Mysql to connect to the docker-mysql of this machine, the…

medium.com

Solution: 

Step 1: access MySQL through docker container

mysql -uroot -p

 

Step 2:

CREATE USER 'root'@'172.17.0.1' IDENTIFIED BY 'password';

Step 3:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'172.17.0.1' WITH GRANT OPTION;

Step 4 :

flush privileges;
exit

 

그런데... 도커에다가 설치를 하였더니 또하나의 문제를 해결 함. 대소문자 구분

show variables like 'lower_case_table_names';

0일 경우 : 대소문자 구분함

1일 경우 : 대소문자 구분안함

그래서 다시 구글링 하여 수정방법을 찾아 봅니다.

vi로 my.cnf 파일을 보도록 하자

그래서 수정하려고 보니 도커에서 vi 편집기가 설치가 안되어 있었음. 또 구글링 하여 vi 편집기 부터 다시 설치

javacpro.tistory.com/75

 

[도커]Docker 컨테이너에 vi(편집기) 설치

이번에 도커에 오라클을 설치하여 개발환경을 구축하고 있다. tnsnames.ora 를 수정하려고 하는데 vi 명령어가 동작하지 않는다. 기본적으로 설치되어있지 않은것같아서 별도로 설치해보았다. 1. 컨

javacpro.tistory.com

여기서 작성한데로 따라해서 편집기 설치 합니다.

그래서 다시 편집 시도합니다.

아래 한줄 추가하고 mysql다시 재기동합니다.

이제 정상 작동 확인 완료

728x90