해결된 질문
작성
·
479
0
서버 작업을 하던 중,
user, post 등 model들을 만들고, model 폴더 안 index.js에서 전부 다 합친 후,
npm run dev 를 하니깐 아래와 같은 에러가 나옵니다.
맨 밑에 pakage.json 도 첨부하겠습니다.
* 비밀번호를 숫자로 설정했는데 이게 영향이 있을까요?
***********************************************************************
^[[D^[[nodemon] restarting due to changes...
[nodemon] starting `node index.js`
(node:654) [SEQUELIZE0004] DeprecationWarning: A boolean value was passed to options.operatorsAliases. This is a no-op with v5 and should be removed.
server is running on http://localhost:3065
internal/crypto/hash.js:58
throw new ERR_INVALID_ARG_TYPE('data',
^
TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be one of type string, TypedArray, or DataView. Received type number
at Hash.update (internal/crypto/hash.js:58:11)
at sha1 (/Users/kim/Desktop/projects/nodebird/backEnd/node_modules/mysql2/lib/auth_41.js:31:8)
at Object.token [as calculateToken] (/Users/kim/Desktop/projects/nodebird/backEnd/node_modules/mysql2/lib/auth_41.js:67:18)
at new HandshakeResponse (/Users/kim/Desktop/projects/nodebird/backEnd/node_modules/mysql2/lib/packets/handshake_response.js:28:26)
at ClientHandshake.sendCredentials (/Users/kim/Desktop/projects/nodebird/backEnd/node_modules/mysql2/lib/commands/client_handshake.js:52:31)
at ClientHandshake.handshakeInit (/Users/kim/Desktop/projects/nodebird/backEnd/node_modules/mysql2/lib/commands/client_handshake.js:137:12)
at ClientHandshake.execute (/Users/kim/Desktop/projects/nodebird/backEnd/node_modules/mysql2/lib/commands/command.js:39:22)
at Connection.handlePacket (/Users/kim/Desktop/projects/nodebird/backEnd/node_modules/mysql2/lib/connection.js:417:32)
at PacketParser.Connection.packetParser.p [as onPacket] (/Users/kim/Desktop/projects/nodebird/backEnd/node_modules/mysql2/lib/connection.js:75:12)
at PacketParser.executeStart (/Users/kim/Desktop/projects/nodebird/backEnd/node_modules/mysql2/lib/packet_parser.js:75:16)
at Socket.Connection.stream.on.data (/Users/kim/Desktop/projects/nodebird/backEnd/node_modules/mysql2/lib/connection.js:82:25)
at Socket.emit (events.js:198:13)
at addChunk (_stream_readable.js:288:12)
at readableAddChunk (_stream_readable.js:269:11)
at Socket.Readable.push (_stream_readable.js:224:10)
at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
[nodemon] app crashed - waiting for file changes before starting...
답변 10
1
0
0
config에 입력하는 password (제로초님은 nodejsbook 으로 설정한 내용)
제가 제 컴퓨터에 설치되어 있는 mysql 접속할때,
myslq -u root -p 'password'
저 위에 'password' 에 들어가는거랑 같아야된다는 말씀이신거죠?
방금 password 찾아서 config에도 변경했습니다.
그리고 아래와 같은 버그가 발생했습니다.
이번에는 이름을 잘못설정한건가요?
Unhandled rejection SequelizeConnectionError: Unknown database 'react-nodebird'
at Promise.tap.then.catch.err (/Users/kim/Desktop/projects/nodebird/back/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:133:19)
at tryCatcher (/Users/kim/Desktop/projects/nodebird/back/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/kim/Desktop/projects/nodebird/back/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/Users/kim/Desktop/projects/nodebird/back/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/Users/kim/Desktop/projects/nodebird/back/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/Users/kim/Desktop/projects/nodebird/back/node_modules/bluebird/js/release/promise.js:725:18)
at _drainQueueStep (/Users/kim/Desktop/projects/nodebird/back/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (/Users/kim/Desktop/projects/nodebird/back/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/Users/kim/Desktop/projects/nodebird/back/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (/Users/kim/Desktop/projects/nodebird/back/node_modules/bluebird/js/release/async.js:15:14)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
0
0
mysql 비밀번호가 틀린거라면, mysql 비밀번호를 어디에 입력해서 틀린거일텐데,
비밀번호를 어디에 입력을 한건가요? 강의보면서 mysql 비밀번호를 입력한 경우가 없었어서요.
정말 몰라서 질문드립니다.ㅠㅠ
환경은 맥 os 사용하고 있고, 다른 질문 글 찾아본 후 mysql@5.7 버전 다운받아서 사용하고 있습니다.
제가 해야 될게,
1. mysql를 설치 후, 비밀번호도 nodejsbook 으로 변경하고,
2. config 파일도 아래처럼 설정하면 되나요?
Unhandled rejection SequelizeAccessDeniedError: Access denied for user 'root'@'localhost' (using password: YES)
위 에러를 해결 하기 위해 MySQL 데이터베이스 비밀번호가 틀렸다고 하셨는데, 제가 어디에 입력을 해서 틀린건지 모르겠습니다.
0
nodebird 비밀번호 말고요. MySQL 데이터베이스 비밀번호가 잘못된 겁니다. MySQL 설치하실 때 비밀번호 설정하셨을 겁니다. 그걸 틀리신 거에요.
0
back을 처음부터 다시 폴더를 생성 후 만들어도 같은 에러가 반복됩니다. 이번에는 처음부터 비밀번호를 문자열로 했는데도 불구하고, 아래와 같은 에러가 계속 반복되네요. 새로 만든다고 해도, mysql에는 이전에 만들어놓는 곳으로 접근을 하나요? npm init 부터 해서 처음부터 다시 만들었는데도 불구하고 같은 에러가 나와서 어떻게 해결해야될지 모르겠습니다.
아래는 에러 메시지 입니다.
[nodemon] restarting due to changes...
[nodemon] starting `node index.js`
(node:2663) [SEQUELIZE0004] DeprecationWarning: A boolean value was passed to options.operatorsAliases. This is a no-op with v5 and should be removed.
server is running on http://localhost:3065
Unhandled rejection SequelizeAccessDeniedError: Access denied for user 'root'@'localhost' (using password: YES)
at Promise.tap.then.catch.err (/Users/kim/Desktop/projects/nodebird/back/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:125:19)
at tryCatcher (/Users/kim/Desktop/projects/nodebird/back/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/kim/Desktop/projects/nodebird/back/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/Users/kim/Desktop/projects/nodebird/back/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/Users/kim/Desktop/projects/nodebird/back/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/Users/kim/Desktop/projects/nodebird/back/node_modules/bluebird/js/release/promise.js:725:18)
at _drainQueueStep (/Users/kim/Desktop/projects/nodebird/back/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (/Users/kim/Desktop/projects/nodebird/back/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/Users/kim/Desktop/projects/nodebird/back/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (/Users/kim/Desktop/projects/nodebird/back/node_modules/bluebird/js/release/async.js:15:14)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
0
원래 비밀번호가 숫자로 1234 였다가, 문자열로 변경해야되서 "node" 로 변경하니깐 위와 같은 에러가 발생했습니다.
기존에 1234 였는데, "1234" 로 변경해서 다시 run 해봐야 할까요?
-> "1234"로 변경해서 했는데도 같은 에러가 나옵니다.
실시간 답변 진심으로 감사드립니다.
ps :
config/config.json 의 비밀번호를 처음에 한번 설정하면 수정이 불가능한건가요? 비밀번호를 입력한적이 없는데, 어디서 틀렸다는건지 이해가 안되었습니다.
0
0
비밀번호를 변경하니깐 아래와 같이 나옵니다.
이와 같은 경우 어떻게 해결 해야 할까요?
Unhandled rejection SequelizeAccessDeniedError: Access denied for user 'root'@'localhost' (using password: YES)
at Promise.tap.then.catch.err (/Users/kim/Desktop/projects/nodebird/backEnd/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:125:19)
at tryCatcher (/Users/kim/Desktop/projects/nodebird/backEnd/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/kim/Desktop/projects/nodebird/backEnd/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/Users/kim/Desktop/projects/nodebird/backEnd/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/Users/kim/Desktop/projects/nodebird/backEnd/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/Users/kim/Desktop/projects/nodebird/backEnd/node_modules/bluebird/js/release/promise.js:725:18)
at _drainQueueStep (/Users/kim/Desktop/projects/nodebird/backEnd/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (/Users/kim/Desktop/projects/nodebird/backEnd/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/Users/kim/Desktop/projects/nodebird/backEnd/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (/Users/kim/Desktop/projects/nodebird/backEnd/node_modules/bluebird/js/release/async.js:15:14)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)