작성
·
439
0
또한, db 지우고 다시 create 해도 계속 대문자로 생성이 되는데 다른 부분을 설정하고 create 해야하나요? 강의에는 해당내용이 없네요
점검해본 사항 입니다. 추가로 확인해봐야할 사항이 있을까요??
1. ip 주소 설정
2. build 는 잘 됩니다.
3. ec2 프론트 ip 주소로 접속하면 시작화면은 나오는데 강의처럼 api 요청을하면 cors 에러가 나고있습니다.
4. ubuntu 환경에서 모든 설정 확인 후 재시작
5. cors 설정
답변 7
0
0
이렇게 나와서 새로고침 후 로그인을 해보니 로그인 시도 1번 하고 다시 새로고침 후 로그인 시도를 하면 로그인이 되네요 ;;
질문하면서도 어디쪽을 염두하고 질문을 드려야할지 막막하네요..
0
0
db 설정 쪽 입니다.
https://github.com/ZeroCho/react-nodebird/blob/master/ch7/back/models/hashtag.js#L14
이 줄처럼 tableName이 소문자면 소문자로 나와야합니다.
0
이건 CORS 문제 이전에 서버에 에러가 있어서 발생한 문제입니다. 백엔드 서버 에러메시지를 확인하셔야 합니다.
pm2 logs --err --lines 200
0|app | Warning: connect.session() MemoryStore is not
0|app | designed for a production environment, as it will leak
0|app | memory, and will not scale past a single process.
0|app | ConnectionError [SequelizeConnectionError]: Unknown database 'react-bird'
0|app | at connect (/home/ubuntu/react-bird/src/server/node_modules/sequelize/dist/lib/dialects/mysql/connection-manager.js:1:2170)
0|app | at processTicksAndRejections (internal/process/task_queues.js:95:5)
0|app | at async c._connect (/home/ubuntu/react-bird/src/server/node_modules/sequelize/dist/lib/dialects/abstract/connection-manager.js:1:4828)
0|app | at async /home/ubuntu/react-bird/src/server/node_modules/sequelize/dist/lib/dialects/abstract/connection-manager.js:1:3852
0|app | at async c.getConnection (/home/ubuntu/react-bird/src/server/node_modules/sequelize/dist/lib/dialects/abstract/connection-manager.js:1:4492)
0|app | at async /home/ubuntu/react-bird/src/server/node_modules/sequelize/dist/lib/sequelize.js:1:6942
0|app | at async w.createTable (/home/ubuntu/react-bird/src/server/node_modules/sequelize/dist/lib/dialects/abstract/query-interface.js:1:2235)
0|app | at async Function.sync (/home/ubuntu/react-bird/src/server/node_modules/sequelize/dist/lib/model.js:1:21209)
0|app | at async r.sync (/home/ubuntu/react-bird/src/server/node_modules/sequelize/dist/lib/sequelize.js:1:8476) {
0|app | parent: Error: Unknown database 'react-bird'
0|app | at Packet.asError (/home/ubuntu/react-bird/src/server/node_modules/mysql2/lib/packets/packet.js:728:17)
0|app | at ClientHandshake.execute (/home/ubuntu/react-bird/src/server/node_modules/mysql2/lib/commands/command.js:29:26)
0|app | at Connection.handlePacket (/home/ubuntu/react-bird/src/server/node_modules/mysql2/lib/connection.js:456:32)
0|app | at PacketParser.onPacket (/home/ubuntu/react-bird/src/server/node_modules/mysql2/lib/connection.js:85:12)
0|app | at PacketParser.executeStart (/home/ubuntu/react-bird/src/server/node_modules/mysql2/lib/packet_parser.js:75:16)
0|app | at Socket.<anonymous> (/home/ubuntu/react-bird/src/server/node_modules/mysql2/lib/connection.js:92:25)
0|app | at Socket.emit (events.js:400:28)
0|app | at addChunk (internal/streams/readable.js:293:12)
0|app | at readableAddChunk (internal/streams/readable.js:267:9)
0|app | at Socket.Readable.push (internal/streams/readable.js:206:10) {
0|app | code: 'ER_BAD_DB_ERROR',
0|app | errno: 1049,
0|app | sqlState: '42000',
0|app | sqlMessage: "Unknown database 'react-bird'",
0|app | sql: undefined
0|app | },
0|app | original: Error: Unknown database 'react-bird'
0|app | at Packet.asError (/home/ubuntu/react-bird/src/server/node_modules/mysql2/lib/packets/packet.js:728:17)
0|app | at ClientHandshake.execute (/home/ubuntu/react-bird/src/server/node_modules/mysql2/lib/commands/command.js:29:26)
0|app | at Connection.handlePacket (/home/ubuntu/react-bird/src/server/node_modules/mysql2/lib/connection.js:456:32)
0|app | at PacketParser.onPacket (/home/ubuntu/react-bird/src/server/node_modules/mysql2/lib/connection.js:85:12)
0|app | at PacketParser.executeStart (/home/ubuntu/react-bird/src/server/node_modules/mysql2/lib/packet_parser.js:75:16)
0|app | at Socket.<anonymous> (/home/ubuntu/react-bird/src/server/node_modules/mysql2/lib/connection.js:92:25)
0|app | at Socket.emit (events.js:400:28)
0|app | at addChunk (internal/streams/readable.js:293:12)
0|app | at readableAddChunk (internal/streams/readable.js:267:9)
0|app | at Socket.Readable.push (internal/streams/readable.js:206:10) {
0|app | code: 'ER_BAD_DB_ERROR',
0|app | errno: 1049,
0|app | sqlState: '42000',
0|app | sqlMessage: "Unknown database 'react-bird'",
0|app | sql: undefined
0|app | }
0|app | }
이런 에러가 나와서 sudo su -> mysql -uroot -p
해서 use react-bird -> show tables; 하면
이렇게 나오면 db 있는거 아닌가요???
0
0
이 설정이 아닙니다. 대문자가 되는 테이블 설정을 보여주세요.