Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 1개 있습니다.)

Windows - MySQL zip 파일 버전의 "mysqld --skip-grant-tables" 실행 시 비정상 종료

mysql의 zip 파일 버전을 다운로드해 압축을 풀고, "mysqld --initialize"를 실행 후 root 계정의 암호 변경을 위해 "start mysqld --skip-grant-tables" 명령어를 실행했더니, 그냥 새 창이 뜨고는 잠시 후에 없어져 버립니다. 이때 이벤트 로그를 보면 다음의 내용이 남는데요,

Log Name:      Application
Source:        Windows Error Reporting
Date:          2021-07-10 오후 8:05:16
Event ID:      1001
Task Category: None
Level:         Information
Keywords:      Classic
User:          N/A
Computer:      TESTPC
Description:
Fault bucket 2155725182767660306, type 4
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P1: mysqld.exe
P2: 8.0.25.0
P3: 6082efcd
P4: mysqld.exe
P5: 8.0.25.0
P6: 6082efcd
P7: 80000003
P8: 0000000001091d62
P9: 
P10: 

...[생략]...

Log Name:      Application
Source:        Application Error
Date:          2021-07-10 오후 8:05:13
Event ID:      1000
Task Category: (100)
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      TESTPC
Description:
Faulting application name: mysqld.exe, version: 8.0.25.0, time stamp: 0x6082efcd
Faulting module name: mysqld.exe, version: 8.0.25.0, time stamp: 0x6082efcd
Exception code: 0x80000003
Fault offset: 0x0000000001091d62
Faulting process id: 0x27d4
Faulting application start time: 0x01d77a326db8d323
Faulting application path: D:\mysql-8.0.25-winx64\bin\mysqld.exe
Faulting module path: D:\mysql-8.0.25-winx64\bin\mysqld.exe
Report Id: 99070596-edff-4556-b746-5c00773b64fd
Faulting package full name: 
Faulting package-relative application ID: 

한마디로 crash가 발생한 것입니다. "procdump -i" 명령어로 뜬 덤프 파일을 windbg로 검사해 보면 다음의 호출 스택을 볼 수 있습니다.

mysqld!my_errno+0x22
ucrtbase!raise+0x1e1
ucrtbase!abort+0x31
mysqld!binary_log::transaction::compression::Zstd_comp::set_compression_level+0x1f9c82
mysqld!binary_log::transaction::compression::Zstd_comp::set_compression_level+0x1f7a33
mysqld!binary_log::transaction::compression::Zstd_comp::set_compression_level+0x15e48f
mysqld!binary_log::transaction::compression::Zstd_comp::set_compression_level+0xb5d94
mysqld!ha_finalize_handlerton+0x47
mysqld!memcached_shutdown+0x1d5a
mysqld!Prealloced_array::push_back+0x352
mysqld!plugin_shutdown+0xd8
mysqld!Item_func::check_valid_arguments_processor+0x321
mysqld!LogEvent::type+0x236
mysqld!setup_conn_event_handler_threads+0x755
mysqld!win_main+0x1af2
mysqld!mysql_service+0xa5
mysqld!mysqld_main+0x5cc
mysqld!set_timespec_nsec+0x6bf88
kernel32!BaseThreadInitThunk+0x14
ntdll!RtlUserThreadStart+0x21

검색해 보면, 위의 내용으로 몇몇 글을 볼 수 있지만 사실상 해결책이 없습니다.




혹시나 환경을 타나 싶어서 Windows 10, Windows Server 2019, Windows Server 2012 R2에서 테스트했으나 증상이 동일했습니다. "mysqld --skip-grant-tables" 명령이 실행돼야 root 계정의 암호를 설정할 수 있는데 ^^; 저것부터 안 되니 "mysql -uroot" 명령어도 그냥 이렇게 오류가 발생합니다.

D:\mysql-8.0.25-winx64\bin> mysql -uroot
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

막막하군요. ^^; 일단, "mysqld --console"을 실행하면 다음과 같이 잘 서비스가 됩니다.

D:\mysql-8.0.25-winx64\bin> mysqld --console 

2021-07-10T14:32:44.652882Z 0 [System] [MY-010116] [Server] D:\mysql-8.0.25-winx64\bin\mysqld.exe (mysqld 8.0.25) starting as process 880
2021-07-10T14:32:44.763559Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-07-10T14:32:46.796149Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-07-10T14:32:48.098412Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060
2021-07-10T14:32:48.681719Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-07-10T14:32:48.690977Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-07-10T14:32:49.038021Z 0 [System] [MY-010931] [Server] D:\mysql-8.0.25-winx64\bin\mysqld.exe: ready for connections. Version: '8.0.25'  socket: ''  port: 3306  MySQL Community Server - GPL.

혹시나 싶어 --console 옵션과 함께 --skip-grant-tables 옵션을 주니, 화면에 로그가 출력이 됩니다.

D:\mysql-8.0.25-winx64\bin> mysqld --console --skip-grant-tables
2021-07-10T14:27:37.440754Z 0 [System] [MY-010116] [Server] D:\mysql-8.0.25-winx64\bin\mysqld.exe (mysqld 8.0.25) starting as process 3336
2021-07-10T14:27:37.563356Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-07-10T14:27:41.256156Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-07-10T14:27:42.170809Z 0 [Warning] [MY-011311] [Server] Plugin mysqlx reported: 'All I/O interfaces are disabled, X Protocol won't be accessible'
2021-07-10T14:27:43.651229Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-07-10T14:27:43.656797Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-07-10T14:27:43.747028Z 0 [System] [MY-010931] [Server] D:\mysql-8.0.25-winx64\bin\mysqld.exe: ready for connections. Version: '8.0.25'  socket: ''  port: 0  MySQL Community Server - GPL.
2021-07-10T14:27:43.756320Z 0 [ERROR] [MY-010131] [Server] TCP/IP, --shared-memory, or --named-pipe should be configured on NT OS
2021-07-10T14:27:43.762431Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-07-10T14:27:45.720592Z 0 [ERROR] [MY-013183] [InnoDB] Assertion failure: trx0sys.cc:585:UT_LIST_GET_LEN(trx_sys->mysql_trx_list) == 0 thread 8488
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
14:27:46 UTC - mysqld got exception 0x80000003 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went terribly wrong...
2021-07-10T14:28:37.982684Z 0 [System] [MY-013105] [Server] D:\mysql-8.0.25-winx64\bin\mysqld.exe: Normal shutdown.
7ff7c5771d62    mysqld.exe!my_sigabrt_handler()[my_thr_init.cc:372]
7ffdc2d6d167    ucrtbase.DLL!raise()
7ffdc2d6dff1    ucrtbase.DLL!abort()
7ff7c5999b42    mysqld.exe!ut_dbg_assertion_failed()[ut0dbg.cc:99]
7ff7c59978f3    mysqld.exe!trx_sys_close()[trx0sys.cc:585]
7ff7c58fe34f    mysqld.exe!srv_shutdown()[srv0start.cc:3648]
7ff7c5855c54    mysqld.exe!innodb_shutdown()[ha_innodb.cc:1410]
7ff7c474ff47    mysqld.exe!ha_finalize_handlerton()[handler.cc:724]
7ff7c477c8aa    mysqld.exe!plugin_deinitialize()[sql_plugin.cc:1116]
7ff7c4781f42    mysqld.exe!reap_plugins()[sql_plugin.cc:1187]
7ff7c4780c18    mysqld.exe!plugin_shutdown()[sql_plugin.cc:2034]
7ff7c471e8f1    mysqld.exe!clean_up()[mysqld.cc:2504]
7ff7c4730f76    mysqld.exe!unireg_abort()[mysqld.cc:2372]
7ff7c472fb85    mysqld.exe!setup_conn_event_handler_threads()[mysqld.cc:3199]
7ff7c4732d62    mysqld.exe!win_main()[mysqld.cc:7591]
7ff7c472caa5    mysqld.exe!mysql_service()[mysqld.cc:7687]
7ff7c472d0ec    mysqld.exe!mysqld_main()[mysqld.cc:7903]
7ff7c5da3078    mysqld.exe!__scrt_common_main_seh()[exe_common.inl:288]
7ffde7cf1412    KERNEL32.DLL!BaseThreadInitThunk()
7ffdea2c54f4    ntdll.dll!RtlUserThreadStart()
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.

그래도 crash가 된다는 점에서는 변함이 없습니다. ^^; 그런데, 중간에 보면 다음과 같은 메시지가 있습니다.

[ERROR] [MY-010131] [Server] TCP/IP, --shared-memory, or --named-pipe should be configured on NT OS

따라서, "--shared-memory" 옵션과 함께 사용하면,

D:\mysql-8.0.25-winx64\bin> mysqld --console --skip-grant-tables --shared-memory
2021-07-10T14:39:33.422973Z 0 [System] [MY-010116] [Server] D:\mysql-8.0.25-winx64\bin\mysqld.exe (mysqld 8.0.25) starting as process 4920
2021-07-10T14:39:33.482257Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-07-10T14:39:37.529997Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-07-10T14:39:39.063351Z 0 [Warning] [MY-011311] [Server] Plugin mysqlx reported: 'All I/O interfaces are disabled, X Protocol won't be accessible'
2021-07-10T14:39:40.103310Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-07-10T14:39:40.111012Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-07-10T14:39:40.316717Z 0 [System] [MY-010931] [Server] D:\mysql-8.0.25-winx64\bin\mysqld.exe: ready for connections. Version: '8.0.25'  socket: ''  port: 0  MySQL Community Server - GPL.

실행이 잘 되는군요. (여기서 좀 이해가 안 됩니다. 어차피 알고 있는 거면 애당초 Windows OS에서 실행되는 경우 --shared-memory를 스스로 적용하면 될 문제 아니었던가요? ^^;)

어쨌든 실행이 되니, 이 상태에서 mysql 연결도 정상적으로 되고 암호 변경도 잘 됩니다.

D:\mysql-8.0.25-winx64\bin> mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 8.0.25 MySQL Community Server - GPL

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> flush privileges;
Query OK, 0 rows affected (0.10 sec)

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
Query OK, 0 rows affected (0.17 sec)

재미있는 것은 "flush privileges;"를 실행하지 않은 상태에서 명령어를 입력하면 이런 식으로 오류가 발생합니다.

// https://stackoverflow.com/questions/36099028/error-1064-42000-you-have-an-error-in-your-sql-syntax-want-to-configure-a-pa

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new_password');
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PASSWORD('new_password')' at line 1

mysql> SET PASSWORD FOR 'root' = PASSWORD('new_password');
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PASSWORD('new_password')' at line 1

mysql> UPDATE user SET authentication_string=password('new_password') WHERE user='root';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('new_password') WHERE user='root'' at line 1

mysql> UPDATE user SET password=password('new_password') WHERE user='root';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('new_password') WHERE user='root'' at line 1

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

도대체가 신비로운 mysql의 비밀번호 설정 방법이군요. ^^;




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

[연관 글]






[최초 등록일: ]
[최종 수정일: 7/17/2021]

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

비밀번호

댓글 작성자
 



2022-07-16 04시03분
[마린이] 와 저랑 똑같은 오류였는데 감사합니다!
[guest]

... 16  17  18  19  20  21  22  23  24  25  26  [27]  28  29  30  ...
NoWriterDateCnt.TitleFile(s)
12947정성태1/30/20227502개발 환경 구성: 634. ffmpeg.exe - 기존 동영상 컨테이너에 다중 스트림을 추가하는 방법
12946정성태1/28/20226027오류 유형: 792. .NET Core - 로컬 개발 중에 docker 호스팅으로 바꾸는 경우 SQL 서버 접근 방법
12945정성태1/28/20226266오류 유형: 791. SQL 서버 로그인 시 localhost는 되고, 127.0.0.1로는 안 되는 문제
12944정성태1/28/20228632.NET Framework: 1143. C# - Entity Framework Core 6 개요
12943정성태1/27/20227546.NET Framework: 1142. .NET 5+로 포팅 시 플랫폼 호환성 경고 메시지(SYSLIB0006, SYSLIB0011, CA1416)파일 다운로드1
12942정성태1/27/20227818.NET Framework: 1141. XmlSerializer와 Dictionary 타입파일 다운로드1
12941정성태1/26/20229219오류 유형: 790. AKS/k8s - pod 상태가 Pending으로 지속되는 경우
12940정성태1/26/20226638오류 유형: 789. AKS에서 hpa에 따른 autoscale 기능이 동작하지 않는다면?
12939정성태1/25/20227323.NET Framework: 1140. C# - ffmpeg(FFmpeg.AutoGen)를 이용해 MP3 오디오 파일 인코딩/디코딩하는 예제파일 다운로드1
12938정성태1/24/20229593개발 환경 구성: 633. Docker Desktop + k8s 환경에서 local 이미지를 사용하는 방법
12937정성태1/24/20227428.NET Framework: 1139. C# - ffmpeg(FFmpeg.AutoGen)를 이용해 오디오(mp2) 인코딩하는 예제(encode_audio.c) [2]파일 다운로드1
12936정성태1/22/20227387.NET Framework: 1138. C# - ffmpeg(FFmpeg.AutoGen)를 이용해 멀티미디어 파일의 메타데이터를 보여주는 예제(metadata.c)파일 다운로드1
12935정성태1/22/20227565.NET Framework: 1137. ffmpeg의 파일 해시 예제(ffhash.c)를 C#으로 포팅파일 다운로드1
12934정성태1/22/20227119오류 유형: 788. Warning C6262 Function uses '65564' bytes of stack: exceeds /analyze:stacksize '16384'. Consider moving some data to heap. [2]
12933정성태1/21/20227677.NET Framework: 1136. C# - ffmpeg(FFmpeg.AutoGen)를 이용해 MP2 오디오 파일 디코딩 예제(decode_audio.c)파일 다운로드1
12932정성태1/20/20228125.NET Framework: 1135. C# - ffmpeg(FFmpeg.AutoGen)로 하드웨어 가속기를 이용한 비디오 디코딩 예제(hw_decode.c) [2]파일 다운로드1
12931정성태1/20/20226285개발 환경 구성: 632. ASP.NET Core 프로젝트를 AKS/k8s에 올리는 과정
12930정성태1/19/20226896개발 환경 구성: 631. AKS/k8s의 Volume에 파일 복사하는 방법
12929정성태1/19/20226672개발 환경 구성: 630. AKS/k8s의 Pod에 Volume 연결하는 방법
12928정성태1/18/20226824개발 환경 구성: 629. AKS/Kubernetes에서 호스팅 중인 pod에 shell(/bin/bash)로 진입하는 방법
12927정성태1/18/20226562개발 환경 구성: 628. AKS 환경에 응용 프로그램 배포 방법
12926정성태1/17/20227047오류 유형: 787. AKS - pod 배포 시 ErrImagePull/ImagePullBackOff 오류
12925정성태1/17/20227164개발 환경 구성: 627. AKS의 준비 단계 - ACR(Azure Container Registry)에 docker 이미지 배포
12924정성태1/15/20228634.NET Framework: 1134. C# - ffmpeg(FFmpeg.AutoGen)를 이용한 비디오 디코딩 예제(decode_video.c) [2]파일 다운로드1
12923정성태1/15/20227598개발 환경 구성: 626. ffmpeg.exe를 사용해 비디오 파일을 MPEG1 포맷으로 변경하는 방법
12922정성태1/14/20226641개발 환경 구성: 625. AKS - Azure Kubernetes Service 생성 및 SLO/SLA 변경 방법
... 16  17  18  19  20  21  22  23  24  25  26  [27]  28  29  30  ...