• Home
  • About
    • lahuman photo

      lahuman

      열심히 사는 아저씨

    • Learn More
    • Facebook
    • LinkedIn
    • Github
  • Posts
    • All Posts
    • All Tags
  • Projects

Node] sequelize에서 mysql 8.0 로그인시 unknown plugin sha256_password 오류 발생

04 Jun 2020

Reading time ~1 minute

Node] sequelize에서 mysql 로그인시 unknown plugin sha256_password 오류 발생

개발서버를 구축하고 테스트를 진행중에 아래와 같은 오류가 발생하였습니다.

node:56906) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead.
2020-06-04 03:30:55.384 KST [error]: main - Server requests authentication using unknown plugin sha256_password. See TODO: add plugins doco here on how to configure or author authentication plugins.

sha256_password 플러그인 설치를 해야 하는건가? 아니면 설정을 추가해야 하는건가 많이 찾아봤는데요.

결론은 Mysql 8.0 이상에서 계정을 생성할때 비밀번호 생성을 아래와 같이 해서 발생한 문제였습니다.

create user '사용자'@'%' identified by '비밀번호';

만약 계정을 생성했다면 다음 명령어로 비밀번호를 업데이트 하면 문제가 해결 됩니다.

ALTER user '사용자'@'%' IDENTIFIED WITH mysql_native_password BY '비밀번호';
flush privileges;

// 또는

use mysql;
update user set authentication_string=password('비밀번호'), plugin='mysql_native_password' where user='사용자';
flush privileges;

mysql_native_password 은 기존 인증방법으로 보안 수준을 낮추지만, 이전 드라이버와 호환이 가능한 비밀번호 암호화 방식입니다.

오늘의 삽질 끝!

참고자료

  • Sequelize와 mysql 연결 에러
  • MySQL 8.0 비밀번호 변경하기! (MySQL 5.7버전 이상)


sequelizenodeerror Share Tweet +1