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

비밀번호

댓글 작성자
 




... 31  32  33  34  [35]  36  37  38  39  40  41  42  43  44  45  ...
NoWriterDateCnt.TitleFile(s)
13189정성태12/9/202222578오류 유형: 831. Visual Studio - Windows Forms 디자이너의 도구 상자에 컨트롤이 보이지 않는 문제
13188정성태12/9/202223368.NET Framework: 2075. C# - 직접 만들어 보는 TaskScheduler 실습 (SingleThreadTaskScheduler) [1]파일 다운로드1
13187정성태12/8/202222748개발 환경 구성: 654. openssl - CA로부터 인증받은 새로운 인증서를 생성하는 방법 (2)
13186정성태12/6/202221479오류 유형: 831. The framework 'Microsoft.AspNetCore.App', version '...' was not found.
13185정성태12/6/202221067개발 환경 구성: 653. Windows 환경에서의 Hello World x64 어셈블리 예제 (NASM 버전)
13184정성태12/5/202217753개발 환경 구성: 652. ml64.exe와 link.exe x64 실행 환경 구성 [1]
13183정성태12/4/202218537오류 유형: 830. MASM + CRT 함수를 사용하는 경우 발생하는 컴파일 오류 정리 [1]
13182정성태12/4/202220697Windows: 217. Windows 환경에서의 Hello World x64 어셈블리 예제 (MASM 버전)
13181정성태12/3/202219425Linux: 54. 리눅스/WSL - hello world 어셈블리 코드 x86/x64 (nasm)
13180정성태12/2/202222034.NET Framework: 2074. C# - 스택 메모리에 대한 여유 공간 확인하는 방법파일 다운로드1
13179정성태12/2/202219242Windows: 216. Windows 11 - 22H2 업데이트 이후 Terminal 대신 cmd 창이 뜨는 경우
13178정성태12/1/202220051Windows: 215. Win32 API 금지된 함수 - IsBadXxxPtr 유의 함수들이 안전하지 않은 이유파일 다운로드1
13177정성태11/30/202220549오류 유형: 829. uwsgi 설치 시 fatal error: Python.h: No such file or directory
13176정성태11/29/202215946오류 유형: 828. gunicorn - ModuleNotFoundError: No module named 'flask'
13175정성태11/29/202222008오류 유형: 827. Python - ImportError: cannot import name 'html5lib' from 'pip._vendor'
13174정성태11/28/202218300.NET Framework: 2073. C# - VMMap처럼 스택 메모리의 reserve/guard/commit 상태 출력파일 다운로드1
13173정성태11/27/202218678.NET Framework: 2072. 닷넷 응용 프로그램의 스레드 스택 크기 변경
13172정성태11/25/202220687.NET Framework: 2071. 닷넷에서 ESP/RSP 레지스터 값을 구하는 방법파일 다운로드1
13171정성태11/25/202218521Windows: 214. 윈도우 - 스레드 스택의 "red zone"
13170정성태11/24/202221967Windows: 213. 윈도우 - 싱글 스레드는 컨텍스트 스위칭이 없을까요?
13169정성태11/23/202222890Windows: 212. 윈도우의 Protected Process (Light) 보안 [1]파일 다운로드2
13168정성태11/22/202217612제니퍼 .NET: 31. 제니퍼 닷넷 적용 사례 (9) - DB 서비스에 부하가 걸렸다?!
13167정성태11/21/202220200.NET Framework: 2070. .NET 7 - Console.ReadKey와 리눅스의 터미널 타입
13166정성태11/20/202220744개발 환경 구성: 651. Windows 사용자 경험으로 WSL 환경에 dotnet 런타임/SDK 설치 방법
13165정성태11/18/202216976개발 환경 구성: 650. Azure - "scm" 프로세스와 엮인 서비스 모음
13164정성태11/18/202220553개발 환경 구성: 649. Azure - 비주얼 스튜디오를 이용한 AppService 원격 디버그 방법
... 31  32  33  34  [35]  36  37  38  39  40  41  42  43  44  45  ...