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

비밀번호

댓글 작성자
 




... 61  62  63  64  65  66  67  68  69  70  71  72  [73]  74  75  ...
NoWriterDateCnt.TitleFile(s)
12233정성태6/19/202024790오류 유형: 619. SQL 서버 - The transaction log for database '...' is full due to 'LOG_BACKUP'. - 두 번째 이야기
12232정성태6/19/202022630오류 유형: 618. SharePoint - StoreBusyRetryLater 오류
12231정성태6/15/202025905.NET Framework: 911. Console/Service Application을 위한 SynchronizationContext - AsyncContext
12230정성태6/15/202024002오류 유형: 617. IMetaDataImport::GetMethodProps가 반환하는 IL 코드 주소(RVA) 문제
12229정성태6/13/202027381.NET Framework: 910. USB/IP PROJECT를 이용해 C#으로 USB Keyboard + Mouse 가상 장치 만들기 [1]
12228정성태6/12/202025066.NET Framework: 909. C# - Source Generator를 적용한 XmlCodeGenerator파일 다운로드1
12227정성태6/12/202030217오류 유형: 616. Visual Studio의 느린 업데이트 속도에 대한 원인 분석 [5]
12226정성태6/11/202029097개발 환경 구성: 493. OpenVPN의 네트워크 구성 [4]파일 다운로드1
12225정성태6/11/202025383개발 환경 구성: 492. 윈도우에 OpenVPN 설치 - 클라이언트 측 구성
12224정성태6/11/202034956개발 환경 구성: 491. 윈도우에 OpenVPN 설치 - 서버 측 구성 [1]
12223정성태6/9/202034764.NET Framework: 908. C# - Source Generator 소개 [10]파일 다운로드2
12222정성태6/3/202024698VS.NET IDE: 146. error information: "CryptQueryObject" (-2147024893/0x80070003)
12221정성태6/3/202024296Windows: 170. 비어 있지 않은 디렉터리로 symbolic link(junction) 연결하는 방법
12220정성태6/3/202029221.NET Framework: 907. C# DLL로부터 TLB 및 C/C++ 헤더 파일(TLH)을 생성하는 방법
12219정성태6/1/202027208.NET Framework: 906. C# - lock (this), lock (typeof(...))를 사용하면 안 되는 이유파일 다운로드1
12218정성태5/27/202025955.NET Framework: 905. C# - DirectX 게임 클라이언트 실행 중 키보드 입력을 감지하는 방법 [3]
12217정성태5/24/202024383오류 유형: 615. Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 0, current count = 1.
12216정성태5/15/202027426.NET Framework: 904. USB/IP PROJECT를 이용해 C#으로 USB Keyboard 가상 장치 만들기 [14]파일 다운로드1
12215정성태5/12/202032235개발 환경 구성: 490. C# - (Wireshark의) USBPcap을 이용한 USB 패킷 모니터링 [10]파일 다운로드1
12214정성태5/5/202026516개발 환경 구성: 489. 정식 인증서가 있는 경우 Device Driver 서명하는 방법 (2) - UEFI/SecureBoot [1]
12213정성태5/3/202025607개발 환경 구성: 488. (User-mode 코드로 가상 USB 장치를 만들 수 있는) USB/IP PROJECT 소개
12212정성태5/1/202023113개발 환경 구성: 487. UEFI / Secure Boot 상태인지 확인하는 방법
12211정성태4/27/202025963개발 환경 구성: 486. WSL에서 Makefile로 공개된 리눅스 환경의 C/C++ 소스 코드 빌드
12210정성태4/20/202027905.NET Framework: 903. .NET Framework의 Strong-named 어셈블리 바인딩 (1) - app.config을 이용한 바인딩 리디렉션 [1]파일 다운로드1
12209정성태4/13/202023143오류 유형: 614. 리눅스 환경에서 C/C++ 프로그램이 Segmentation fault 에러가 발생한 경우 (2)
12208정성태4/12/202021741Linux: 29. 리눅스 환경에서 C/C++ 프로그램이 Segmentation fault 에러가 발생한 경우
... 61  62  63  64  65  66  67  68  69  70  71  72  [73]  74  75  ...