반응형
Node 서버를 사용하는 경우에 Sequelize를 통한 MySQL 연결시, 오류가 아래와 같이 난다면?
⌗ 오류현상
Unhandled rejection SequelizeConnectionError:
Client does not support authentication protocol requested by server;
consider upgrading MySQL client at /Users/jenny/Documents/nodejs-book-master/ch7/JennyExample(7.6)/learn-sequeluze/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:133:19
at tryCatcher (/Users/jenny/Documents/nodejs-book-master/ch7/JennyExample(7.6)/learn-sequeluze/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/jenny/Documents/nodejs-book-master/ch7/JennyExample(7.6)/learn-sequeluze/node_modules/bluebird/js/release/promise.js:517:31)
at Promise._settlePromise (/Users/jenny/Documents/nodejs-book-master/ch7/JennyExample(7.6)/learn-sequeluze/node_modules/bluebird/js/release/promise.js:574:18)
at Promise._settlePromise0 (/Users/jenny/Documents/nodejs-book-master/ch7/JennyExample(7.6)/learn-sequeluze/node_modules/bluebird/js/release/promise.js:619:10)
at Promise._settlePromises (/Users/jenny/Documents/nodejs-book-master/ch7/JennyExample(7.6)/learn-sequeluze/node_modules/bluebird/js/release/promise.js:695:18)
at _drainQueueStep (/Users/jenny/Documents/nodejs-book-master/ch7/JennyExample(7.6)/learn-sequeluze/node_modules/bluebird/js/release/async.js:138:12)
at _drainQueue (/Users/jenny/Documents/nodejs-book-master/ch7/JennyExample(7.6)/learn-sequeluze/node_modules/bluebird/js/release/async.js:131:9)
at Async._drainQueues (/Users/jenny/Documents/nodejs-book-master/ch7/JennyExample(7.6)/learn-sequeluze/node_modules/bluebird/js/release/async.js:147:5)
at Immediate.Async.drainQueues [as _onImmediate] (/Users/jenny/Documents/nodejs-book-master/ch7/JennyExample(7.6)/learn-sequeluze/node_modules/bluebird/js/release/async.js:17:14)
at processImmediate (internal/timers.js:439:21)
⌗ 해결방법
(1) MySQL version을 5.7로 설치
(2) MySQL version이 8인 경우,
legacy authentication을 활성화(2-1)하거나 mysql_native_password(2-2)를 사용
(2-1) legacy authentication을 활성화 경로
mysql installer > server 옆에 reconfigure > Auth 설정가서 legacy 선택 > 완료 선택
(2-2) mysql_native_password 사용
use mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '사용할 패스워드';
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '****';
Query OK, 0 rows affected (0.01 sec)
반응형
'Javascript > NodeJS' 카테고리의 다른 글
[NodeJS] Window10 환경, bcrypt 설치 오류 해결 (0) | 2019.11.16 |
---|---|
[NodeJs][MySQL] Sequelize를 통해 설치 후 배포 환경에 따른 데이터베이스 설정 (0) | 2019.11.16 |
[NodeJs] 웹 서버 커스터마이징 설정 (0) | 2019.11.16 |
[NodeJs] 기본 개념 (0) | 2019.11.16 |