Study/AWS
문제해결 - [RDS] {database name} does not exist
RGB234
2024. 7. 1. 18:23
app.module.ts
@Module({
imports: [
ConfigModule.forRoot({
isGlobal: true,
}),
TypeOrmModule.forRootAsync({
imports: [ConfigModule],
useFactory: async (configService: ConfigService) => ({
type: 'mysql',
host: configService.get<string>('DB_HOST'),
port: configService.get<number>('DB_PORT'),
username: configService.get<string>('DB_USERNAME'),
password: configService.get<string>('DB_PASSWORD'),
database: configService.get<string>('DB_DATABASE'),
// With that option specified, every entity registered through the forFeature() method
// will be automatically added to the entities array of the configuration object.
autoLoadEntities: true,
// entities: [Authentication, User, Room, UserToRoom, Message],
retryAttempts: 3,
}),
inject: [ConfigService],
}),
// ...
],
controllers: [AppController],
providers: [AppService],
})
database 항목은 (mySQL workbench 에서 연결된) DB 에 존재하는 스키마 중 하나의 이름으로 지정되어야 한다.
새로 이름을 정해주는 것이 아니다.