mysql 3

ERROR [TypeOrmModule] Unable to connect to the database. Retrying /src/entity/user.entity.ts:1import { Entity, Column, PrimaryGeneratedColumn } from "typeorm";

typeorm을 활용해서 NestJs DB 연결중 생긴 에러 원인 entity를 제대로 찾지 못함 해결방법 TypeOrmMoudule.forRoot부분에 entities 경로를 구조에 맞게 잘 작성 프로젝트 폴더 구조 entities: [__dirname + '/entity/**/*.entity{.ts,.js}',], 이렇게 경로 수정 ERROR [ExceptionHandler] No repository for "EntityName" was found. Looks like this entity is not registered in current "default" connection? 수정 후 이런 에러 발생. import { Entity, Column, PrimaryGeneratedColumn } fro..

NestJs 도커로 MySql 연동하기

OS: 윈도우11 설치된 Mysql 버전을 확인해줍니다. $ mysql --version mysql Ver 8.0.28 for Win64 on x86_64 (MySQL Community Server - GPL) 저는 8.0.28 버전이 깔려있네요. Docker를 설치해 줍니다. https://www.docker.com/products/docker-desktop Docker Desktop for Mac and Windows | Docker Learn why Docker Desktop is the preferred choice for millions of developers building containerized applications. Download for Mac or Windows. www.docke..

[nestjs]Error: listen EADDRINUSE: address already in use :::3306

백엔드 개발도 해보고 싶어서 nestjs로 mysql과 연동을 하던 중 생긴 문제 3306포트를 죽인 후 services.msc에서 mysql을 다시 실행해도 계속 저 문제로 도돌이표처럼 돌아왔다. 계속 해매다가 발견한 해결방법은 정말 간단했다. mysql은 3306포트를 쓰고 nestjs는 3000포트를 써야된다는것 app.module.ts에선 TypeOrmModule.forRoot({ type: 'mysql', host: 'localhost', port: 3306, username: 'root', password: '1548seaw', database: 'todo', entities: [User], synchronize: false, }), 이렇게 mysql부분 port를 3306으로 연결해주고 ma..