포스트

MySQL 설치 에러

안녕하세요 🐸

공부하는 노트북 장비를 바꾸게 되어 새롭게 MySQL을 설치하다 생긴 에러 내용과 해결 방법을 공유합니다.

에러

위의 화면 처럼 Initializing database 단계에서 에러가 발생하고 있습니다.
Log 탭에서는 아래의 로그가 남았습니다.


Successfully added the Windows Firewall rule.
Ended configuration step: Updating Windows Firewall rules

Beginning configuration step: Adjusting Windows service

Attempting to grant the required filesystem permissions to the 'NT AUTHORITY\NetworkService' account.
Granted permissions to the data directory.
Adding new service
New service added
Ended configuration step: Adjusting Windows service

Beginning configuration step: Initializing database (may take a long time)

Attempting to run MySQL Server with --initialize-insecure option...
Starting process for MySQL Server 8.0.36...
Starting process with command: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --console --initialize-insecure=on --lower-case-table-names=1...
C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.36) initializing of server in progress as process 20472
mysqld: File '.\?곗???bin.index' not found (OS errno 2 - No such file or directory)
The designated data directory C:\ProgramData\MySQL\MySQL Server 8.0\Data\ is unusable. You can remove all files that the server added to it.
Aborting
C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.36)  MySQL Community Server - GPL.
Process for mysqld, with ID 20472, was run successfully and exited with code 1.
Failed to start process for MySQL Server 8.0.36.
Database initialization failed.
Ended configuration step: Initializing database (may take a long time)

원인

mysqld: File ‘.\?곗???bin.index’ not found (OS errno 2 - No such file or directory) The designated data directory C:\ProgramData\MySQL\MySQL Server 8.0\Data\ is unusable. You can remove all files that the server added to it.

위의 내용에서 알 수 있는 것은 두갖

  1. '.\?곗???bin.index' 이라는 파일을 찾지 못했다는 것
  2. C:\ProgramData\MySQL\MySQL Server 8.0\Data\ 경로를 사용할 수 없다는 것 입니다.
    일단 먼저 수상해보이는 점은 '.\?곗???bin.index' 이라는 깨진 문자가 발견된 것 입니다.
    이렇게 깨진 문자가 발견된다면 십중팔구 유니코드 문제입니다.

여기까지는 파악을 했지만 정확하게 왜 유니코드 문제가 발생하는 것인지에 대해서는 알기가 어려웠는데요.
센님의 블로그에서 친절하게도 해당 에러 발생 원인에 대해서도 다음과 같이 설명해주셨습니다.

그러나 여전히 문제는 해결되지 않았고, 구글링 결과 MySQL8.0 이상의 버전에서 한글 인코딩이 되지 않기 때문이라는 해답을 얻었다.

해결 방법

윈도우에서 국가 또는 지역 -> 관리자 옵션 -> 시스템 로캘 변경 -> "Beta:세계 언어 지원을 위해 Unicode UTF-8 사용" 체크 후 재부팅


참조 : https://velog.io/@suhsein/%EC%8B%9C%EC%8A%A4%ED%85%9C-utf8-%EC%9D%B8%EC%BD%94%EB%94%A9-%EC%84%A4%EC%A0%95

이 기사는 저작권자의 CC BY 4.0 라이센스를 따릅니다.