• [MySQL] 오류해결 : Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT) for operation '='

    [MySQL] 오류해결 : Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT) for operation '='

    발생 새 테이블을 추가하고 다른 테이블과 조인하려고 하는데 아래와 같은 에러가 발생 Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT) for operation '=' 원인 기존 테이블과 새 테이블의 Collate 값이 달라서 발생 해결 ALTER TABLE {테이블명} CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

  • [NestJS] 간단한 미들웨어를 만들어 IP 차단하기

    [NestJS] 간단한 미들웨어를 만들어 IP 차단하기

    미들웨어 파일 생성 // ./middleware/IpFilterMiddleware.ts import { Injectable, NestMiddleware, UnauthorizedException } from '@nestjs/common'; import { NextFunction, Request, Response } from 'express'; @Injectable() export class IpFilterMiddleware implements NestMiddleware { async use(req: Request, res: Response, next: NextFunction) { const ipAddress = req.headers['cf-connecting-ip']; if (ipAddress == '차단..