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)
12938정성태1/24/202225300개발 환경 구성: 633. Docker Desktop + k8s 환경에서 local 이미지를 사용하는 방법
12937정성태1/24/202222868.NET Framework: 1139. C# - ffmpeg(FFmpeg.AutoGen)를 이용해 오디오(mp2) 인코딩하는 예제(encode_audio.c) [2]파일 다운로드1
12936정성태1/22/202221216.NET Framework: 1138. C# - ffmpeg(FFmpeg.AutoGen)를 이용해 멀티미디어 파일의 메타데이터를 보여주는 예제(metadata.c)파일 다운로드1
12935정성태1/22/202223347.NET Framework: 1137. ffmpeg의 파일 해시 예제(ffhash.c)를 C#으로 포팅파일 다운로드1
12934정성태1/22/202222125오류 유형: 788. Warning C6262 Function uses '65564' bytes of stack: exceeds /analyze:stacksize '16384'. Consider moving some data to heap. [2]
12933정성태1/21/202223098.NET Framework: 1136. C# - ffmpeg(FFmpeg.AutoGen)를 이용해 MP2 오디오 파일 디코딩 예제(decode_audio.c)파일 다운로드1
12932정성태1/20/202225070.NET Framework: 1135. C# - ffmpeg(FFmpeg.AutoGen)로 하드웨어 가속기를 이용한 비디오 디코딩 예제(hw_decode.c) [2]파일 다운로드1
12931정성태1/20/202220204개발 환경 구성: 632. ASP.NET Core 프로젝트를 AKS/k8s에 올리는 과정
12930정성태1/19/202220093개발 환경 구성: 631. AKS/k8s의 Volume에 파일 복사하는 방법
12929정성태1/19/202221189개발 환경 구성: 630. AKS/k8s의 Pod에 Volume 연결하는 방법
12928정성태1/18/202219784개발 환경 구성: 629. AKS/Kubernetes에서 호스팅 중인 pod에 shell(/bin/bash)로 진입하는 방법
12927정성태1/18/202221843개발 환경 구성: 628. AKS 환경에 응용 프로그램 배포 방법
12926정성태1/17/202220881오류 유형: 787. AKS - pod 배포 시 ErrImagePull/ImagePullBackOff 오류
12925정성태1/17/202222630개발 환경 구성: 627. AKS의 준비 단계 - ACR(Azure Container Registry)에 docker 이미지 배포
12924정성태1/15/202223138.NET Framework: 1134. C# - ffmpeg(FFmpeg.AutoGen)를 이용한 비디오 디코딩 예제(decode_video.c) [2]파일 다운로드1
12923정성태1/15/202223284개발 환경 구성: 626. ffmpeg.exe를 사용해 비디오 파일을 MPEG1 포맷으로 변경하는 방법
12922정성태1/14/202221840개발 환경 구성: 625. AKS - Azure Kubernetes Service 생성 및 SLO/SLA 변경 방법
12921정성태1/14/202217502개발 환경 구성: 624. Docker Desktop에서 별도 서버에 설치한 docker registry에 이미지 올리는 방법
12920정성태1/14/202218958오류 유형: 786. Camtasia - An error occurred with the camera: Failed to Add Video Sampler.
12919정성태1/13/202218903Windows: 199. Host Network Service (HNS)에 의해서 점유되는 포트
12918정성태1/13/202220702Linux: 47. WSL - shell script에서 설정한 환경 변수가 스크립트 실행 후 반영되지 않는 문제
12917정성태1/12/202219456오류 유형: 785. C# - The type or namespace name '...' could not be found (are you missing a using directive or an assembly reference?)
12916정성태1/12/202218650오류 유형: 784. TFS - One or more source control bindings for this solution are not valid and are listed below.
12915정성태1/11/202219698오류 유형: 783. Visual Studio - We didn't find any interpreters
12914정성태1/11/202224193VS.NET IDE: 172. 비주얼 스튜디오 2022의 파이선 개발 환경 지원
12913정성태1/11/202224442.NET Framework: 1133. C# - byte * (바이트 포인터)를 FileStream으로 쓰는 방법 [1]
... 31  32  33  34  35  36  37  38  39  40  41  42  43  44  [45]  ...