mysql with docker

DB 2018. 4. 25. 17:18

mysql docker 설치 후 접속 시 아래 에러가 나온다면..

Error No. 2058

Plugin caching_sha2_password could not be loaded: 


mysql 콘솔 접속하여 

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';

하거나..

컨테이너 생성시 --default-authentication-plugin=mysql_native_password 옵션 추가

sudo docker run -p 3306:3306 --name t-mysql -e MYSQL_ROOT_PASSWORD=root -d library/mysql:8.0.11 --default-authentication-plugin=mysql_native_password


DB, user 생성

CREATE DATABASE test;

CREATE USER 'test'@'%' IDENTIFIED BY 'test';

GRANT ALL PRIVILEGES on test.* TO 'test'@'%';

-- 특정 권한 : GRANT INSERT,UPDATE,INDEX,ALTER ON on test.* TO 'test'@'%';

FLUSH PRIVILEGES;