Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (seongtaejeong at gmail.com)
홈페이지
첨부 파일
 

(시리즈 글이 2개 있습니다.)
오류 유형: 734. MySQL - Authentication method 'caching_sha2_password' not supported by any of the available plugins.
; https://www.sysnet.pe.kr/2/0/12707

오류 유형: 988. docker - MySql "--initialize specified but the redo log directory ./#innodb_redo/ has redo log files inside. Aborting."
; https://www.sysnet.pe.kr/2/0/14044




docker - MySql "--initialize specified but the redo log directory ./#innodb_redo/ has redo log files inside. Aborting."

mysql 컨테이너를 실행했더니,

$ docker run --name mysql1 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=testpw -v mysql:/var/lib/mysql mysql:8.0.43
2025-11-10 05:44:09+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.43-1.el9 started.
2025-11-10 05:44:09+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2025-11-10 05:44:09+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.43-1.el9 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2025-11-10T05:44:10.468786Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2025-11-10T05:44:10.472100Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.43) starting as process 1
2025-11-10T05:44:10.483501Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2025-11-10T05:44:10.955416Z 1 [ERROR] [MY-013860] [InnoDB] --initialize specified but the redo log directory ./#innodb_redo/ has redo log files inside. Aborting.
2025-11-10T05:44:10.955503Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
2025-11-10T05:44:11.083275Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2025-11-10T05:44:11.083594Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2025-11-10T05:44:11.083639Z 0 [ERROR] [MY-010119] [Server] Aborting
2025-11-10T05:44:11.084456Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.43)  MySQL Community Server - GPL.

위와 같이 "--initialize specified but the redo log directory ./#innodb_redo/ has redo log files inside. Aborting." 오류 메시지를 내면서 실패합니다. 검색 결과 해당 디렉터리를 삭제해야 한다고 하는데... 일단은 테스트 DB이므로 부담없이 시키는 대로 지웠습니다. ^^

$ docker run --name mysql1 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=testpw -v mysql:/var/lib/mysql -it mysql:8.0.43 /bin/bash

# ls \#inno* -ld
drwxr-x--- 2 mysql mysql 4096 Nov 10 05:38 '#innodb_redo'
drwxr-x--- 2 mysql mysql  187 Nov 10 05:43 '#innodb_temp'

# cd \#innodb_redo

# pwd
/var/lib/mysql/#innodb_redo

# rm \#ib_redo*

이후 서버는 잘 올라옵니다.




그나저나, 클라이언트에서 접속할 때 인증 문제가 또 뜨는군요. ^^;

MySQL: MySql.Data.MySqlClient.MySqlException (0x80004005): Authentication method 'caching_sha2_password' not supported by any of the available plugins.
   at MySql.Data.MySqlClient.Authentication.AuthenticationPluginManager.GetPlugin(String method)
   at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.GetPlugin(String method, NativeDriver driver, Byte[] authData)
   at MySql.Data.MySqlClient.NativeDriver.Authenticate(String authMethod, Boolean reset)
   at MySql.Data.MySqlClient.NativeDriver.Open()
   at MySql.Data.MySqlClient.Driver.Open()
   at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
   at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
   at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
   at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
   at MySql.Data.MySqlClient.MySqlPool.GetConnection()
   at MySql.Data.MySqlClient.MySqlConnection.Open()
    ...[생략]...

지난 글에서도 살펴봤지만,

MySQL - Authentication method 'caching_sha2_password' not supported by any of the available plugins.
; https://www.sysnet.pe.kr/2/0/12707

이번엔 사용자가 mysql_native_password로 생성된 상태였습니다.

mysql> SELECT User, Host, plugin FROM mysql.user;
+------------------+-----------+-----------------------+
| User             | Host      | plugin                |
+------------------+-----------+-----------------------+
| nativeuser       | %         | mysql_native_password |
| root             | %         | caching_sha2_password |
| mysql.infoschema | localhost | caching_sha2_password |
| mysql.session    | localhost | caching_sha2_password |
| mysql.sys        | localhost | caching_sha2_password |
| root             | localhost | caching_sha2_password |
+------------------+-----------+-----------------------+

그러고 보니, 지난 글에서 my.cnf 파일에 기본 인증 방식을 제공해야 한다고 했었는데요,

$ cat /etc/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html

[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M

# Remove leading # to revert to previous value for default_authentication_plugin,
# this will increase compatibility with older clients. For background, see:
# https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_authentication_plugin
# default-authentication-plugin=mysql_native_password
skip-host-cache
skip-name-resolve
datadir=/var/lib/mysql
socket=/var/run/mysqld/mysqld.sock
secure-file-priv=/var/lib/mysql-files
user=mysql

pid-file=/var/run/mysqld/mysqld.pid
[client]
socket=/var/run/mysqld/mysqld.sock

!includedir /etc/mysql/conf.d/

이번엔 저 설정값을 명시적으로 (주석 해제시켜) 설정했더니 정상적으로 DB 연결이 됐습니다. 이 과정에서 사소한 문제가 있다면, 저 컨테이너에는 기본적인 vi 편집기도 없다는 점이었는데요, 그래서 sed 도구를 이용해 문자열을 치환하는 방식으로 수정했습니다.

# sed 's/# default-authentication/default-authentication/g' /etc/my.cnf > /etc/my2.cnf
# mv /etc/my2.cnf /etc/my.cnf




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]







[최초 등록일: ]
[최종 수정일: 11/13/2025]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... 46  47  48  49  [50]  51  52  53  54  55  56  57  58  59  60  ...
NoWriterDateCnt.TitleFile(s)
12812정성태8/28/202122497.NET Framework: 1108. C# 10 - (10) 개선된 #line 지시자
12811정성태8/27/202122786Linux: 44. 윈도우 개발자를 위한 리눅스 fork 동작 방식 설명 (파이썬 코드)
12810정성태8/27/202122283.NET Framework: 1107. .NET Core/5+에서 동적 컴파일한 C# 코드를 (Breakpoint도 활용하며) 디버깅하는 방법 - #line 지시자파일 다운로드1
12809정성태8/26/202120791.NET Framework: 1106. .NET Core/5+에서 C# 코드를 동적으로 컴파일/사용하는 방법 [1]파일 다운로드1
12808정성태8/25/202125340오류 유형: 758. go: ...: missing go.sum entry; to add it: go mod download ...
12807정성태8/25/202125521.NET Framework: 1105. C# 10 - (9) 비동기 메서드가 사용할 AsyncMethodBuilder 선택 가능파일 다운로드1
12806정성태8/24/202120916개발 환경 구성: 601. PyCharm - 다중 프로세스 디버깅 방법
12805정성태8/24/202121952.NET Framework: 1104. C# 10 - (8) 분해 구문에서 기존 변수의 재사용 가능파일 다운로드1
12804정성태8/24/202122084.NET Framework: 1103. C# 10 - (7) Source Generator V2 APIs
12803정성태8/23/202122750개발 환경 구성: 600. pip cache 디렉터리 옮기는 방법
12802정성태8/23/202124018.NET Framework: 1102. .NET Conf Mini 21.08 - WinUI 3 따라해 보기 [1]
12801정성태8/23/202124593.NET Framework: 1101. C# 10 - (6) record class 타입의 ToString 메서드를 sealed 처리 허용파일 다운로드1
12800정성태8/22/202124149개발 환경 구성: 599. PyCharm - (반대로) 원격 프로세스가 PyCharm에 디버그 연결하는 방법
12799정성태8/22/202125513.NET Framework: 1100. C# 10 - (5) 속성 패턴의 개선파일 다운로드1
12798정성태8/21/202123710개발 환경 구성: 598. PyCharm - 원격 프로세스를 디버그하는 방법
12797정성태8/21/202123319Windows: 197. TCP의 MSS(Maximum Segment Size) 크기는 고정된 것일까요?
12796정성태8/21/202124405.NET Framework: 1099. C# 10 - (4) 상수 문자열에 포맷 식 사용 가능파일 다운로드1
12795정성태8/20/202123234.NET Framework: 1098. .NET 6에 포함된 신규 BCL API - 스레드 관련
12794정성태8/20/202123655스크립트: 23. 파이썬 - WSGI를 만족하는 최소한의 구현 코드 및 PyCharm에서의 디버깅 방법 [1]
12793정성태8/20/202123102.NET Framework: 1097. C# 10 - (3) 개선된 변수 초기화 판정파일 다운로드1
12792정성태8/19/202127351.NET Framework: 1096. C# 10 - (2) 전역 네임스페이스 선언파일 다운로드1
12791정성태8/19/202122187.NET Framework: 1095. C# COM 개체를 C++에서 사용하는 예제 [3]파일 다운로드1
12790정성태8/18/202125980.NET Framework: 1094. C# 10 - (1) 구조체를 생성하는 record struct파일 다운로드1
12789정성태8/18/202125578개발 환경 구성: 597. PyCharm - 윈도우 환경에서 WSL을 이용해 파이썬 앱 개발/디버깅하는 방법
12788정성태8/17/202122949.NET Framework: 1093. C# - 인터페이스의 메서드가 다형성을 제공할까요? (virtual일까요?)파일 다운로드1
12787정성태8/17/202123518.NET Framework: 1092. (책 내용 수정) "4.5.1.4 인터페이스"의 "인터페이스와 다형성"
... 46  47  48  49  [50]  51  52  53  54  55  56  57  58  59  60  ...