This error when i try to use typeorm in nestjs
i did setting for using typeorm like this
app.module.ts
import { Module } from '@nestjs/common';
import { GraphQLModule } from '@nestjs/graphql';
import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo';
import { UserModule } from './user/user.module';
import { TypeOrmModule } from '@nestjs/typeorm';
import config from './ormconfig';
import { User } from './user/user.entity';
@Module({
imports: [
TypeOrmModule.forRoot({
type: 'mysql', //Database 설정
host: 'localhost',
port: 3306,
username: 'root',
password: "",
database: 'hinest',
entities: [User], // Entity 연결
synchronize: true,
}),
GraphQLModule.forRoot<ApolloDriverConfig>({
driver: ApolloDriver,
debug: false,
playground: false,
autoSchemaFile: 'schema.gpl'
}),
UserModule,
TypeOrmModule.forFeature([User])
],
controllers: [],
providers: [],
})
export class AppModule { }
Some People said "You have to start mysql" so i did "mysql.server start" or "mysql.server restart" but error still lives..
if you want to see anthor code i can show that
i can not do nothing cuz this erorr
plz help me..
you can change the host of the connection to
127.0.0.1
as well