[SQL] varchar(50)은 몇 글자를 저장할 수 있을까?

2022. 11. 8. 15:12·📂 Infra & System
728x90
반응형

varchar(50)에 몇 글자가 저장될까?

한글은 3바이트라서 50 % 3 즉 16글자 정도 저장이 될 줄 알았다.

하지만 프런트 단에서 확인 결과 16글자 이상 저장이 되어 확인해 보았다.

 

1. mysql에서의 글자수 저장


mysql4.0 버전까지 varchar(50)은 바이트를 의미하고 

mysql5.0 버전까지 varchar(50)은 charaters를 의미한다

 

즉 mysql4.0버전 이상이면 varchar(50)은 50글자가 저장된다.


https://dev.mysql.com/doc/refman/8.0/en/char.html

링크를 확인해보면

`The CHAR and VARCHAR types are declared with a length that indicates the maximum number of characters you want to store. For example, CHAR(30) can hold up to 30 characters.` 이라고 나와있다.

728x90

 

728x90
반응형
저작자표시 비영리 변경금지 (새창열림)

'📂 Infra & System' 카테고리의 다른 글

👋 클라우드 모니터링 서비스 비교하기(데이터독 vs 뉴렐릭 ) | 뉴렐릭 세미나를 다녀오고,  (2) 2024.03.19
[서버] 누구나 Vultr 이용해서 백엔드 서버 구축하기  (0) 2023.06.11
[AWS] Remove the existing file and try again, or run npm npm ERR! with --force to overwrite files recklessly. 오류 해결하기  (0) 2022.12.24
[Firebase] firebase.json이란?  (0) 2021.04.23
[Firebase] Firebase시작하기, 초기설정, firebase init 분석  (2) 2021.04.23
'📂 Infra & System' 카테고리의 다른 글
  • [서버] 누구나 Vultr 이용해서 백엔드 서버 구축하기
  • [AWS] Remove the existing file and try again, or run npm npm ERR! with --force to overwrite files recklessly. 오류 해결하기
  • [Firebase] firebase.json이란?
  • [Firebase] Firebase시작하기, 초기설정, firebase init 분석
foodev
foodev
이것저것 개발과 이것저것 리뷰 합니다.
    반응형
    250x250
  • foodev
    개발 개맛집
    foodev
  • 전체
    오늘
    어제
    • 분류 전체보기 (104) N
      • ⭐ Featured (4)
      • 📂 Backend Engineering (36)
      • 📂 Troubleshooting & Ops (10)
      • 📂 Infra & System (7) N
      • 📂 Reflections (21)
        • Year-in-Review (5)
        • Work & Career (10)
        • Lessons Learned (6)
      • 📂 Team Journal (10)
      • 📂 Archive (16)
  • 블로그 메뉴

    • 홈
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    di란
    토이프로젝트개발일지
    QueryDSL
    typedi란
    githubaction 라벨 배포
    해피해킹 카라비너
    스냅샷과 히스토리
    스냅샷과히스토리성 차이
    Azure 로그 최소 저장 30일
    인프라 로그 저장 비용 감소하는 방법
    창업패키지후기
    typedi 동작원리
    di동작원리
    JPA
    해피해킹 커스텀
    개발썰
    해피해킹 키매핑
    validation failed (numeric string is expected)
    di의존성
    githubaction 라벨 ci/cd
    서이추
    db 날림
    해피해킹 방향키
    azure ci/cd
    db 날린 썰
    해피해킹 꿀팁
    nestjs pipe
    Azure log 비용 줄이기
    nestjs pipe body
    db 초기화
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
foodev
[SQL] varchar(50)은 몇 글자를 저장할 수 있을까?
상단으로

티스토리툴바