Written on
·
904
0
vim env 까지 진행 해서 password까지는 문제 없이 실행이 되어서,
dialect: "mysql"
여기까지 실행이 되다가 에러가 뜬 거 같거든요..
ubuntu@ip-172-31-15-69:~$ cd serverjs-nextproject/
ubuntu@ip-172-31-15-69:~/serverjs-nextproject$ npx sequelize db:create
Sequelize CLI [Node: 14.21.3, CLI: 6.6.0, ORM: 6.28.0]
Loaded configuration file "config/config.js".
ERROR: Dialect undefined does not support db:create / db:drop commands
ubuntu@ip-172-31-15-69:~/serverjs-nextproject$ ls
app.js controllers models node_modules package.json routes
config index.js mysql-apt-config_0.8.13-1_all.deb package-lock.json passport uploads
ubuntu@ip-172-31-15-69:~/serverjs-nextproject$ cd node_modules/
ubuntu@ip-172-31-15-69:~/serverjs-nextproject/node_modules$ ls
@mapbox encodeurl memoizee safe-buffer
@types es5-ext merge-descriptors safer-buffer
abbrev es6-iterator methods semver
accepts es6-symbol mime send
agent-base es6-weak-map mime-db seq-queue
ansi-regex escalade mime-types sequelize
ansi-styles escape-html minimatch sequelize-cli
anymatch etag minimist sequelize-pool
append-field event-emitter minipass serve-static
aproba express minizlib set-blocking
are-we-there-yet express-session mkdirp setprototypeof
array-flatten ext moment side-channel
at-least-node fill-range moment-timezone sigmund
balanced-match finalhandler morgan signal-exit
basic-auth forwarded ms simple-update-notifier
bcrypt fresh multer sqlstring
bignumber.js fs-extra mysql statuses
binary-extensions fs-minipass mysql2 streamsearch
bluebird fs.realpath named-placeholders string-width
body-parser function-bind negotiator string_decoder
brace-expansion gauge next-tick strip-ansi
braces generate-function node-addon-api supports-color
buffer-from get-caller-file node-fetch supports-preserve-symlinks-flag
busboy get-intrinsic nodemon tar
bytes glob nopt timers-ext
call-bind glob-parent normalize-path to-regex-range
chokidar graceful-fs npmlog toidentifier
chownr has object-assign toposort-class
cli-color has-flag object-inspect touch
cliui has-symbols on-finished tr46
color-convert has-unicode on-headers type
color-name http-errors once type-is
color-support https-proxy-agent parseurl typedarray
commander iconv-lite passport uid-safe
concat-map ignore-by-default passport-local umzug
concat-stream inflection passport-strategy undefsafe
config-chain inflight path-is-absolute universalify
console-control-strings inherits path-parse unpipe
content-disposition ini path-to-regexp util-deprecate
content-type ipaddr.js pause utils-merge
cookie is-binary-path pg-connection-string uuid
cookie-parser is-core-module picomatch validator
cookie-signature is-extglob process-nextick-args vary
core-util-is is-fullwidth-code-point proto-list webidl-conversions
cors is-glob proxy-addr whatwg-url
d is-number pseudomap wide-align
debug is-promise pstree.remy wkx
delegates is-property qs wrap-ansi
denque isarray random-bytes wrappy
depd js-beautify range-parser xtend
destroy jsonfile raw-body y18n
detect-libc lodash readable-stream yallist
dotenv long readdirp yargs
dottie lru-cache require-directory yargs-parser
editorconfig lru-queue resolve
ee-first make-dir retry-as-promised
emoji-regex media-typer rimraf
ubuntu@ip-172-31-15-69:~/serverjs-nextproject/node_modules$
mysql-apt-config_0.8.13-1_all.deb, mysql, mysql2 다 잘 깔려 있는데 도대체 모가 문제일까요...ㅠㅠ
Answer 8
0
헉!! 됐어요!! 로컬과 우분투의 차이라는 개념을 제가 제대로 몰라서 발생했던 에러네요!!
root@ip-172-31-15-69:/home/ubuntu/serverjs-nextproject# npx sequelize db:create --env=development
Sequelize CLI [Node: 14.21.3, CLI: 6.6.0, ORM: 6.28.0]
Loaded configuration file "config/config.js".
Using environment "development".
Database next_db created.
감사합니다
0
vim으로 config/config.js 에서 port:8889 부분을 제거 하고 다시 시도를 했더니, 또 다른 에러가 나오네요.
root@ip-172-31-15-69:/home/ubuntu/serverjs-nextproject# npx sequelize db:create --env=development
Sequelize CLI [Node: 14.21.3, CLI: 6.6.0, ORM: 6.28.0]
Loaded configuration file "config/config.js".
Using environment "development".
ERROR: Access denied for user 'root'@'localhost' (using password: YES)
다른 에러로 넘어간 걸 보아 서버 실행은 됐다는 뜻인 거 같은데 맞나요??
0
config/config.js 작성은 이렇게 하였습니다
root@ip-172-31-15-69:/home/ubuntu/serverjs-nextproject/config# cat config.js
const dotenv = require('dotenv');
dotenv.config();
const conf = {
development: {
username: "root",
password: process.env.DB_PASSWORD,
database: "next_db",
host: "127.0.0.1",
port: 8889,
dialect: "mysql",
},
test: {
username: "root",
password: process.env.DB_PASSWORD,
database: "next_db",
host: "127.0.0.1",
port: 8889,
dialect: "mysql"
},
production: {
username: "root",
password: process.env.DB_PASSWORD,
database: "next_db",
host: "127.0.0.1",
port: 8889,
dialect: "mysql"
}
}
0
오오 이번에는 전과 다른 에러가 떠요!
root@ip-172-31-15-69:/home/ubuntu/serverjs-nextproject# npx sequelize db:create --env=development
Sequelize CLI [Node: 14.21.3, CLI: 6.6.0, ORM: 6.28.0]
Loaded configuration file "config/config.js".
Using environment "development".
ERROR: connect ECONNREFUSED 127.0.0.1:8889
0
0
여기를 참고 해봤는데요 https://github.com/taylonr/postman/issues/2
여기를 봐도 뭔가 부족한 거 같거든요 제 상황에는...
로컬로 했을 때는 되는 거랑은 상관이 없나요?