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)
13139정성태10/9/202219601.NET Framework: 2057. 리눅스 환경의 .NET Core 3/5+ 메모리 덤프로부터 모든 닷넷 모듈을 추출하는 방법파일 다운로드1
13138정성태10/8/202222739.NET Framework: 2056. C# - await 비동기 호출을 기대한 메서드가 동기로 호출되었을 때의 부작용 [1]
13137정성태10/8/202222622.NET Framework: 2055. 리눅스 환경의 .NET Core 3/5+ 메모리 덤프로부터 닷넷 모듈을 추출하는 방법
13136정성태10/7/202220859.NET Framework: 2054. .NET Core/5+ SDK 설치 없이 dotnet-dump 사용하는 방법
13135정성태10/5/202222918.NET Framework: 2053. 리눅스 환경의 .NET Core 3/5+ 메모리 덤프를 분석하는 방법 - 두 번째 이야기 [1]
13134정성태10/4/202217356오류 유형: 820. There is a problem with AMD Radeon RX 5600 XT device. For more information, search for 'graphics device driver error code 31'
13133정성태10/4/202220484Windows: 211. Windows - (commit이 아닌) reserved 메모리 사용량 확인 방법 [1]
13132정성태10/3/202219530스크립트: 42. 파이썬 - latexify-py 패키지 소개 - 함수를 mathjax 식으로 표현
13131정성태10/3/202224434.NET Framework: 2052. C# - Windows Forms의 데이터 바인딩 지원(DataBinding, DataSource) [2]파일 다운로드1
13130정성태9/28/202220475.NET Framework: 2051. .NET Core/5+ - 에러 로깅을 위한 Middleware가 동작하지 않는 경우파일 다운로드1
13129정성태9/27/202220841.NET Framework: 2050. .NET Core를 IIS에서 호스팅하는 경우 .NET Framework CLR이 함께 로드되는 환경
13128정성태9/23/202224422C/C++: 158. Visual C++ - IDL 구문 중 "unsigned long"을 인식하지 못하는 #import [1]파일 다운로드1
13127정성태9/22/202221646Windows: 210. WSL에 systemd 도입
13126정성태9/15/202221969.NET Framework: 2049. C# 11 - 정적 메서드에 대한 delegate 처리 시 cache 적용
13125정성태9/14/202222466.NET Framework: 2048. C# 11 - 구조체 필드의 자동 초기화(auto-default structs)
13124정성태9/13/202222850.NET Framework: 2047. Golang, Python, C#에서의 CRC32 사용
13123정성태9/8/202222895.NET Framework: 2046. C# 11 - 멤버(속성/필드)에 지정할 수 있는 required 예약어 추가
13122정성태8/26/202224006.NET Framework: 2045. C# 11 - 메서드 매개 변수에 대한 nameof 지원
13121정성태8/23/202217783C/C++: 157. Golang - 구조체의 slice 필드를 Reflection을 이용해 변경하는 방법
13120정성태8/19/202223212Windows: 209. Windows NT Service에서 UI를 다루는 방법 [3]
13119정성태8/18/202223370.NET Framework: 2044. .NET Core/5+ 프로젝트에서 참조 DLL이 보관된 공통 디렉터리를 지정하는 방법
13118정성태8/18/202218774.NET Framework: 2043. WPF Color의 기본 색 영역은 (sRGB가 아닌) scRGB [2]
13117정성태8/17/202223358.NET Framework: 2042. C# 11 - 파일 범위 내에서 유효한 타입 정의 (File-local types)파일 다운로드1
13116정성태8/4/202223544.NET Framework: 2041. C# - Socket.Close 시 Socket.Receive 메서드에서 예외가 발생하는 문제파일 다운로드1
13115정성태8/3/202224551.NET Framework: 2040. C# - ValueTask와 Task의 성능 비교 [1]파일 다운로드1
13114정성태8/2/202225116.NET Framework: 2039. C# - Task와 비교해 본 ValueTask 사용법파일 다운로드1
... 31  32  33  34  35  36  [37]  38  39  40  41  42  43  44  45  ...