在配置文件中包含选项--skip-grant表后,mysqld会立即启动、运行,然后停止



我的情况如下。我记不起我的root用户访问mysqld的密码了。我正在尝试使用my.ini配置文件中的选项--skip-grant-tables来启动mysqld。然而,我观察到,当我启用该选项,然后尝试重新启动mysqld(例如,从任务管理器(时,服务会启动、运行,然后立即停止。我附上了一段Screencastify视频,向你展示我所采取的步骤(1分50秒长(。我还包括下面的错误文件内容供您审查。我看到有人提到一个错误,但我不明白它传达的信息。

2022-08-25T17:52:06.012094Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2022-08-25T17:52:06.015237Z 0 [System] [MY-010116] [Server] C:Program FilesMySQLMySQL Server 8.0binmysqld.exe (mysqld 8.0.28) starting as process 1048
2022-08-25T17:52:06.045494Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-08-25T17:52:06.398313Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-08-25T17:52:06.642873Z 0 [Warning] [MY-011311] [Server] Plugin mysqlx reported: 'All I/O interfaces are disabled, X Protocol won't be accessible'
2022-08-25T17:52:06.725383Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2022-08-25T17:52:06.726481Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2022-08-25T17:52:06.757168Z 0 [System] [MY-010931] [Server] C:Program FilesMySQLMySQL Server 8.0binmysqld.exe: ready for connections. Version: '8.0.28'  socket: ''  port: 0  MySQL Community Server - GPL.
2022-08-25T17:52:06.759476Z 0 [ERROR] [MY-010131] [Server] TCP/IP, --shared-memory, or --named-pipe should be configured on NT OS
2022-08-25T17:52:06.760755Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-08-25T17:52:07.903037Z 0 [ERROR] [MY-013183] [InnoDB] Assertion failure: trx0sys.cc:644:UT_LIST_GET_LEN(trx_sys->mysql_trx_list) == 0 thread 26320
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.
17:52:07 UTC - mysqld got exception 0x16 ;
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...
7ff78a48fd48    mysqld.exe!?my_print_stacktrace@@YAXPEBEK@Z()
7ff7896c004b    mysqld.exe!?print_fatal_signal@@YAXH@Z()
7ff7896bfe13    mysqld.exe!?my_server_abort@@YAXXZ()
7ff78a47643a    mysqld.exe!?my_abort@@YAXXZ()
7ff78a6ac579    mysqld.exe!??$endl@DU?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@@Z()
7ff78a5e8167    mysqld.exe!?set_compression_level@Zstd_comp@compression@transaction@binary_log@@UEAAXI@Z()
7ff78a67033b    mysqld.exe!??$endl@DU?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@@Z()
7ff78a568550    mysqld.exe!?set_compression_level@Zstd_comp@compression@transaction@binary_log@@UEAAXI@Z()
7ff7894a452b    mysqld.exe!?ha_finalize_handlerton@@YAHPEAUst_plugin_int@@@Z()
7ff7894e2304    mysqld.exe!?memcached_shutdown@@YAXXZ()
7ff7894e78d9    mysqld.exe!?plugin_unlock_list@@YAXPEAVTHD@@PEAPEAUst_plugin_int@@_K@Z()
7ff7894e6630    mysqld.exe!?plugin_shutdown@@YAXXZ()
7ff789482d49    mysqld.exe!?check_valid_arguments_processor@Item_func@@UEAA_NPEAE@Z()
7ff78949679a    mysqld.exe!?underflow@?$basic_stringbuf@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@MEAAHXZ()
7ff78949531f    mysqld.exe!?setup_conn_event_handler_threads@@YAXXZ()
7ff7894988be    mysqld.exe!?win_main@@YAHHPEAPEAD@Z()
7ff7894916f5    mysqld.exe!?mysql_service@@YAHPEAX@Z()
7ff789491d54    mysqld.exe!?mysqld_main@@YAHHPEAPEAD@Z()
7ff78ab0b298    mysqld.exe!?set_timespec_nsec@@YAXPEAUtimespec@@_K@Z()
7ffe8b437034    KERNEL32.DLL!BaseThreadInitThunk()
7ffe8b742651    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.

任何帮助都将不胜感激。非常感谢。

在配置文件的服务器部分启用共享内存解决了问题。请参阅这篇Stackoverflow文章了解上下文。

如果您在启动MySQL时遇到问题,请尝试编辑my.ini配置文件,并将innodb_force_recovery设置为3。

以下是我在Centos上重置MySQL根密码的方法;请注意,它来自命令行。

systemctl stop mysqld
systemctl set-environment MYSQLD_OPTS=--skip-grant-tables
systemctl start mysqld
mysql> UPDATE mysql.user SET authentication_string = PASSWORD ('ENTER_NEW_PASSWORD') WHERE User = 'root' AND Host = 'localhost'; 
mysql> FLUSH PRIVILEGES; 
mysql> quit
systemctl stop mysqld
systemctl unset-environment MYSQLD_OPTS
systemctl start mysqld
# test #
mysql -u root@localhost -p

最新更新