log files

查看数据库中log file信息

SQL> col member format a50
SQL> select group#,status,type,member from v$logfile;

    GROUP# STATUS  TYPE    MEMBER
---------- ------- ------- --------------------------------------------------
         3         ONLINE  D:\APP\MARYHU\ORADATA\ARCERZHANGDB\REDO03.LOG
         2         ONLINE  D:\APP\MARYHU\ORADATA\ARCERZHANGDB\REDO02.LOG
         1         ONLINE  D:\APP\MARYHU\ORADATA\ARCERZHANGDB\REDO01.LOG

SQL> select group#,bytes,members from v$log;

    GROUP#      BYTES    MEMBERS
---------- ---------- ----------
         1   52428800          1
         2   52428800          1
         3   52428800          1
View Code

查看日志组文件信息

SQL> set linesize 200
SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIME          NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ------------------- ------------ -------------------
         1          1         45   52428800        512          2 YES INACTIVE               1545714 2013/07/04 10:05:02      1570213 2013/07/04 10:39:57
         2          1         46   52428800        512          2 NO  CURRENT                1570213 2013/07/04 10:39:57   2.8147E+14
         3          2         39   52428800        512          2 NO  CURRENT                1579090 2013/07/04 12:50:24   2.8147E+14 2013/07/04 12:50:24
         4          2         38   52428800        512          2 YES INACTIVE               1570199 2013/07/04 10:39:54      1570205 2013/07/04 10:39:54

SQL> select 52428800/1024/1024 m from dual;

         M
----------
        50
View Code

 

 

转载于:https://www.cnblogs.com/arcer/p/3142724.html

2012-08-04T13:34:48.100295Z 0 [System] [MY-013169] [Server] D:\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.42) initializing of server in progress as process 6020 2012-08-04T13:34:48.236300Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2012-08-04T13:35:07.144382Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. 2012-08-04T13:35:39.446231Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option. 2012-08-04T13:36:01.826510Z 0 [System] [MY-013169] [Server] D:\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.42) initializing of server in progress as process 4016 2012-08-04T13:36:01.829510Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting. 2012-08-04T13:36:01.830510Z 0 [ERROR] [MY-013236] [Server] The designated data directory D:\MySQL Server 8.0\Data\ is unusable. You can remove all files that the server added to it. 2012-08-04T13:36:01.833510Z 0 [ERROR] [MY-010119] [Server] Aborting 2012-08-04T13:36:01.833512Z 0 [System] [MY-010910] [Server] D:\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.42) MySQL Community Server - GPL. 2012-08-04T13:50:50.554656Z 0 [System] [MY-010116] [Server] D:\MySQL Server 8.0\bin\mysqld (mysqld 8.0.42) starting as process 4652 2012-08-04T13:50:50.619657Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2012-08-04T13:50:50.814669Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2012-08-04T13:50:50.815669Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2012-08-04T13:50:50.829669Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2012-08-04T13:50:50.830669Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2012-08-04T13:50:50.830670Z 0 [ERROR] [MY-010119] [Server] Aborting 2012-08-04T13:50:50.831674Z 0 [System] [MY-010910] [Server] D:\MySQL Server 8.0\bin\mysqld: Shutdown complete (mysqld 8.0.42) MySQL Community Server - GPL. 2012-08-04T13:51:39.728468Z 0 [System] [MY-010116] [Server] D:\MySQL Server 8.0\bin\mysqld (mysqld 8.0.42) starting as process 2836 2012-08-04T13:51:39.749467Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2012-08-04T13:51:39.933478Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2012-08-04T13:51:39.934478Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2012-08-04T13:51:39.938478Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2012-08-04T13:51:39.939478Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2012-08-04T13:51:39.939479Z 0 [ERROR] [MY-010119] [Server] Aborting 2012-08-04T13:51:39.940482Z 0 [System] [MY-010910] [Server] D:\MySQL Server 8.0\bin\mysqld: Shutdown complete (mysqld 8.0.42) MySQL Community Server - GPL. 2025-06-26T11:26:32.458715Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2025-06-26T11:26:32.474315Z 0 [Warning] '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. 2025-06-26T11:26:32.474315Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set. 2025-06-26T11:26:32.474315Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled 2025-06-26T11:26:32.786315Z 0 [Note] mysqld (mysqld 5.7.31) starting as process 6620 ... 2025-06-26T11:26:33.098315Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2025-06-26T11:26:33.098315Z 0 [Note] InnoDB: Uses event mutexes 2025-06-26T11:26:33.098315Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier 2025-06-26T11:26:33.098315Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 2025-06-26T11:26:33.113915Z 0 [Note] InnoDB: Number of pools: 1 2025-06-26T11:26:33.129515Z 0 [Note] InnoDB: Not using CPU crc32 instructions 2025-06-26T11:26:33.191915Z 0 [Note] InnoDB: Initializing buffer pool, total size = 64M, instances = 1, chunk size = 64M 2025-06-26T11:26:33.191915Z 0 [Note] InnoDB: Completed initialization of buffer pool 2025-06-26T11:26:33.332315Z 0 [ERROR] InnoDB: Cannot create log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2025-06-26T11:26:33.332315Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error 2025-06-26T11:26:33.550715Z 0 [ERROR] Plugin 'InnoDB' init function returned error. 2025-06-26T11:26:33.550715Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 2025-06-26T11:26:33.550715Z 0 [ERROR] Failed to initialize builtin plugins. 2025-06-26T11:26:33.550715Z 0 [ERROR] Aborting 2025-06-26T11:26:33.550715Z 0 [Note] Binlog end 2025-06-26T11:26:33.566315Z 0 [Note] Shutting down plugin 'CSV' 2025-06-26T11:26:33.566315Z 0 [Note] mysqld: Shutdown complete 2025-06-26T11:29:24.760715Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2025-06-26T11:29:24.760715Z 0 [Warning] '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. 2025-06-26T11:29:24.760715Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set. 2025-06-26T11:29:24.760715Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled 2025-06-26T11:29:24.760715Z 0 [Note] MySQL57 (mysqld 5.7.31) starting as process 6856 ... 2025-06-26T11:29:24.776315Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2025-06-26T11:29:24.776315Z 0 [Note] InnoDB: Uses event mutexes 2025-06-26T11:29:24.776315Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier 2025-06-26T11:29:24.776315Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 2025-06-26T11:29:24.776315Z 0 [Note] InnoDB: Number of pools: 1 2025-06-26T11:29:24.776315Z 0 [Note] InnoDB: Not using CPU crc32 instructions 2025-06-26T11:29:24.791915Z 0 [Note] InnoDB: Initializing buffer pool, total size = 64M, instances = 1, chunk size = 64M 2025-06-26T11:29:24.807515Z 0 [Note] InnoDB: Completed initialization of buffer pool 2025-06-26T11:29:25.072715Z 0 [ERROR] InnoDB: Cannot create log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2025-06-26T11:29:25.072715Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error 2025-06-26T11:29:25.400315Z 0 [ERROR] Plugin 'InnoDB' init function returned error. 2025-06-26T11:29:25.400315Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 2025-06-26T11:29:25.400315Z 0 [ERROR] Failed to initialize builtin plugins. 2025-06-26T11:29:25.400315Z 0 [ERROR] Aborting 2025-06-26T11:29:25.400315Z 0 [Note] Binlog end 2025-06-26T11:29:25.400315Z 0 [Note] Shutting down plugin 'CSV' 2025-06-26T11:29:25.400315Z 0 [Note] MySQL57: Shutdown complete 2025-06-26T11:30:11.679515Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2025-06-26T11:30:11.679515Z 0 [Warning] '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. 2025-06-26T11:30:11.679515Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set. 2025-06-26T11:30:11.679515Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled 2025-06-26T11:30:11.680515Z 0 [Note] MySQL57 (mysqld 5.7.31) starting as process 1328 ... 2025-06-26T11:30:11.696515Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2025-06-26T11:30:11.697515Z 0 [Note] InnoDB: Uses event mutexes 2025-06-26T11:30:11.698515Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier 2025-06-26T11:30:11.698515Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 2025-06-26T11:30:11.699515Z 0 [Note] InnoDB: Number of pools: 1 2025-06-26T11:30:11.700515Z 0 [Note] InnoDB: Not using CPU crc32 instructions 2025-06-26T11:30:11.707515Z 0 [Note] InnoDB: Initializing buffer pool, total size = 64M, instances = 1, chunk size = 64M 2025-06-26T11:30:11.727515Z 0 [Note] InnoDB: Completed initialization of buffer pool 2025-06-26T11:30:11.785515Z 0 [ERROR] InnoDB: Cannot create log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2025-06-26T11:30:11.786515Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error 2025-06-26T11:30:11.987515Z 0 [ERROR] Plugin 'InnoDB' init function returned error. 2025-06-26T11:30:11.987515Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 2025-06-26T11:30:11.988515Z 0 [ERROR] Failed to initialize builtin plugins. 2025-06-26T11:30:11.988515Z 0 [ERROR] Aborting 2025-06-26T11:30:11.989515Z 0 [Note] Binlog end 2025-06-26T11:30:11.989515Z 0 [Note] Shutting down plugin 'CSV' 2025-06-26T11:30:11.990515Z 0 [Note] MySQL57: Shutdown complete 2025-06-26T11:32:29.799516Z 0 [System] [MY-010116] [Server] D:\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.42) starting as process 6768 2025-06-26T11:32:29.932515Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2025-06-26T11:32:30.217515Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2025-06-26T11:32:30.218515Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2025-06-26T11:32:30.222515Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2025-06-26T11:32:30.223515Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2025-06-26T11:32:30.223516Z 0 [ERROR] [MY-010119] [Server] Aborting 2025-06-26T11:32:30.225515Z 0 [System] [MY-010910] [Server] D:\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.42) MySQL Community Server - GPL. 2025-06-26T11:33:11.431517Z 0 [System] [MY-010116] [Server] D:\MySQL Server 8.0\bin\mysqld (mysqld 8.0.42) starting as process 5844 2025-06-26T11:33:11.453515Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2025-06-26T11:33:11.646515Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2025-06-26T11:33:11.647515Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2025-06-26T11:33:11.651515Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2025-06-26T11:33:11.652515Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2025-06-26T11:33:11.652516Z 0 [ERROR] [MY-010119] [Server] Aborting 2025-06-26T11:33:11.653519Z 0 [System] [MY-010910] [Server] D:\MySQL Server 8.0\bin\mysqld: Shutdown complete (mysqld 8.0.42) MySQL Community Server - GPL. 2025-06-26T11:37:44.455517Z 0 [System] [MY-013169] [Server] D:\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.42) initializing of server in progress as process 5416 2025-06-26T11:37:44.459515Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting. 2025-06-26T11:37:44.460515Z 0 [ERROR] [MY-013236] [Server] The designated data directory D:\MySQL Server 8.0\data\ is unusable. You can remove all files that the server added to it. 2025-06-26T11:37:44.477515Z 0 [ERROR] [MY-010119] [Server] Aborting 2025-06-26T11:37:44.477517Z 0 [System] [MY-010910] [Server] D:\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.42) MySQL Community Server - GPL. 2025-06-26T11:37:47.993517Z 0 [System] [MY-013169] [Server] D:\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.42) initializing of server in progress as process 3268 2025-06-26T11:37:47.996515Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting. 2025-06-26T11:37:47.997515Z 0 [ERROR] [MY-013236] [Server] The designated data directory D:\MySQL Server 8.0\data\ is unusable. You can remove all files that the server added to it. 2025-06-26T11:37:47.999515Z 0 [ERROR] [MY-010119] [Server] Aborting 2025-06-26T11:37:48.000516Z 0 [System] [MY-010910] [Server] D:\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.42) MySQL Community Server - GPL. 2025-06-26T11:44:45.414317Z 0 [System] [MY-013169] [Server] D:\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.42) initializing of server in progress as process 7160 2025-06-26T11:44:45.417315Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting. 2025-06-26T11:44:45.418315Z 0 [ERROR] [MY-013236] [Server] The designated data directory D:\MySQL Server 8.0\data\ is unusable. You can remove all files that the server added to it. 2025-06-26T11:44:45.421315Z 0 [ERROR] [MY-010119] [Server] Aborting 2025-06-26T11:44:45.421317Z 0 [System] [MY-010910] [Server] D:\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.42) MySQL Community Server - GPL. 2025-06-26T11:50:18.940316Z 0 [System] [MY-010116] [Server] D:\MySQL Server 8.0\bin\mysqld (mysqld 8.0.42) starting as process 2960 2025-06-26T11:50:19.707315Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2025-06-26T11:50:20.882315Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2025-06-26T11:50:20.889315Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2025-06-26T11:50:20.933315Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2025-06-26T11:50:20.943315Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2025-06-26T11:50:20.943316Z 0 [ERROR] [MY-010119] [Server] Aborting 2025-06-26T11:50:21.013315Z 0 [System] [MY-010910] [Server] D:\MySQL Server 8.0\bin\mysqld: Shutdown complete (mysqld 8.0.42) MySQL Community Server - GPL. 2025-06-26T11:54:54.948317Z 0 [System] [MY-010116] [Server] D:\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.42) starting as process 5396 2025-06-26T11:54:55.006315Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2025-06-26T11:54:55.988315Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2025-06-26T11:54:56.000315Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2025-06-26T11:54:56.044315Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2025-06-26T11:54:56.054315Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2025-06-26T11:54:56.055315Z 0 [ERROR] [MY-010119] [Server] Aborting 2025-06-26T11:54:56.124315Z 0 [System] [MY-010910] [Server] D:\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.42) MySQL Community Server - GPL. 2025-06-26T11:54:59.535315Z 0 [ERROR] [MY-010083] [Server] --verbose is for use with --help; did you mean --log-error-verbosity? 2025-06-26T11:54:59.536316Z 0 [System] [MY-010116] [Server] D:\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.42) starting as process 6260 2025-06-26T11:54:59.557315Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2025-06-26T11:54:59.763315Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2025-06-26T11:54:59.764315Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2025-06-26T11:54:59.768315Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2025-06-26T11:54:59.769315Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2025-06-26T11:54:59.769316Z 0 [ERROR] [MY-010119] [Server] Aborting 2025-06-26T11:54:59.770320Z 0 [System] [MY-010910] [Server] D:\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.42) MySQL Community Server - GPL. 2025-06-26T11:55:49.378317Z 0 [System] [MY-010116] [Server] D:\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.42) starting as process 6884 2025-06-26T11:55:49.412315Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2025-06-26T11:55:49.607315Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2025-06-26T11:55:49.608315Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2025-06-26T11:55:49.612315Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2025-06-26T11:55:49.613315Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2025-06-26T11:55:49.613316Z 0 [ERROR] [MY-010119] [Server] Aborting 2025-06-26T11:55:49.614319Z 0 [System] [MY-010910] [Server] D:\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.42) MySQL Community Server - GPL. 2025-06-26T11:59:23.848317Z 0 [System] [MY-010116] [Server] D:\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.42) starting as process 6500 2025-06-26T11:59:23.870315Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2025-06-26T11:59:24.138315Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2025-06-26T11:59:24.145315Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2025-06-26T11:59:24.190315Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2025-06-26T11:59:24.199315Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2025-06-26T11:59:24.200315Z 0 [ERROR] [MY-010119] [Server] Aborting 2025-06-26T11:59:24.270315Z 0 [System] [MY-010910] [Server] D:\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.42) MySQL Community Server - GPL. 2025-06-26T12:00:11.464315Z 0 [ERROR] [MY-010083] [Server] --verbose is for use with --help; did you mean --log-error-verbosity? 2025-06-26T12:00:11.464318Z 0 [System] [MY-010116] [Server] D:\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.42) starting as process 5528 2025-06-26T12:00:11.506315Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2025-06-26T12:00:11.712315Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2025-06-26T12:00:11.713315Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2025-06-26T12:00:11.717315Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2025-06-26T12:00:11.718315Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2025-06-26T12:00:11.718316Z 0 [ERROR] [MY-010119] [Server] Aborting 2025-06-26T12:00:11.719319Z 0 [System] [MY-010910] [Server] D:\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.42) MySQL Community Server - GPL. 2025-06-26T12:00:48.273317Z 0 [System] [MY-010116] [Server] D:\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.42) starting as process 6076 2025-06-26T12:00:48.312315Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2025-06-26T12:00:48.525315Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2025-06-26T12:00:48.526315Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2025-06-26T12:00:48.530315Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2025-06-26T12:00:48.531315Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2025-06-26T12:00:48.531316Z 0 [ERROR] [MY-010119] [Server] Aborting 2025-06-26T12:00:48.532320Z 0 [System] [MY-010910] [Server] D:\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.42) MySQL Community Server - GPL. 2025-06-26T12:02:01.665317Z 0 [System] [MY-010116] [Server] D:\MySQL Server 8.0\bin\mysqld (mysqld 8.0.42) starting as process 5008 2025-06-26T12:02:01.715315Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2025-06-26T12:02:01.927315Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2025-06-26T12:02:01.928315Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2025-06-26T12:02:01.932315Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2025-06-26T12:02:01.933315Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2025-06-26T12:02:01.933316Z 0 [ERROR] [MY-010119] [Server] Aborting 2025-06-26T12:02:01.934320Z 0 [System] [MY-010910] [Server] D:\MySQL Server 8.0\bin\mysqld: Shutdown complete (mysqld 8.0.42) MySQL Community Server - GPL. 2025-06-27T08:49:33.665262Z 0 [System] [MY-010116] [Server] D:\MySQL Server 8.0\bin\mysqld (mysqld 8.0.42) starting as process 1656 2025-06-27T08:49:38.251669Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2025-06-27T08:49:38.782070Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2025-06-27T08:49:38.813270Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2025-06-27T08:49:38.875670Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2025-06-27T08:49:38.891270Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2025-06-27T08:49:38.891271Z 0 [ERROR] [MY-010119] [Server] Aborting 2025-06-27T08:49:38.922470Z 0 [System] [MY-010910] [Server] D:\MySQL Server 8.0\bin\mysqld: Shutdown complete (mysqld 8.0.42) MySQL Community Server - GPL. 2025-06-27T09:23:59.010941Z 0 [System] [MY-010116] [Server] D:\MySQL Server 8.0\bin\mysqld (mysqld 8.0.42) starting as process 5100 2025-06-27T09:24:00.153005Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2025-06-27T09:24:00.765040Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2025-06-27T09:24:00.776041Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2025-06-27T09:24:00.802042Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2025-06-27T09:24:00.810043Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2025-06-27T09:24:00.811043Z 0 [ERROR] [MY-010119] [Server] Aborting 2025-06-27T09:24:00.851045Z 0 [System] [MY-010910] [Server] D:\MySQL Server 8.0\bin\mysqld: Shutdown complete (mysqld 8.0.42) MySQL Community Server - GPL. 2025-06-27T10:45:57.915815Z 0 [System] [MY-010116] [Server] D:\MySQL Server 8.0\bin\mysqld (mysqld 8.0.42) starting as process 3404 2025-06-27T10:45:58.574852Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2025-06-27T10:45:59.277892Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2025-06-27T10:45:59.289893Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2025-06-27T10:45:59.315895Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2025-06-27T10:45:59.323895Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2025-06-27T10:45:59.323896Z 0 [ERROR] [MY-010119] [Server] Aborting 2025-06-27T10:45:59.363897Z 0 [System] [MY-010910] [Server] D:\MySQL Server 8.0\bin\mysqld: Shutdown complete (mysqld 8.0.42) MySQL Community Server - GPL. 2025-06-27T10:47:26.056858Z 0 [System] [MY-010116] [Server] D:\MySQL Server 8.0\bin\mysqld (mysqld 8.0.42) starting as process 4556 2025-06-27T10:47:26.083857Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2025-06-27T10:47:26.411876Z 1 [ERROR] [MY-012960] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files. 2025-06-27T10:47:26.412876Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error. 2025-06-27T10:47:26.416876Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine 2025-06-27T10:47:26.417877Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed. 2025-06-27T10:47:26.417878Z 0 [ERROR] [MY-010119] [Server] Aborting 2025-06-27T10:47:26.418882Z 0 [System] [MY-010910] [Server] D:\MySQL Server 8.0\bin\mysqld: Shutdown complete (mysqld 8.0.42) MySQL Community Server - GPL.
06-28
<think>根据提供的日志,主要问题集中在InnoDB引擎初始化失败,错误信息为:"Cannot createredolog filesbecause datafiles arecorrupt orthe databasewas notshut downcleanlyafter creatingthe datafiles."同时,在尝试初始化时,也出现了数据目录非空的错误(当使用--initialize时)。综合日志,问题可能包括:1.数据目录(D:\MySQL Server8.0\data\)已经存在文件,且这些文件可能损坏或不完整。2.数据库没有正常关闭导致数据文件损坏(特别是redolog文件)。解决方案:步骤1:备份当前数据目录(以防万一需要恢复)步骤2:清理数据目录(删除所有文件),然后重新初始化数据库。步骤3:如果重新初始化后仍然失败,则考虑是否存在权限问题或磁盘问题。详细步骤:1.停止MySQL服务(如果正在运行):netstop MySQL802.备份数据目录(例如,将整个data目录复制到其他地方备份)3.删除数据目录下的所有文件和子目录(注意:这将删除所有数据库数据,请确保已备份重要数据!)默认数据目录:D:\MySQLServer8.0\data\4.重新初始化MySQL:打开命令提示符(以管理员身份),执行:```cmdcd "D:\MySQL Server8.0\bin"mysqld --initialize --console```注意:--initialize会生成一个临时root密码,请记录控制台输出的密码(通常在最后一行)。5.启动MySQL服务:net startMySQL806.使用生成的临时密码登录,并修改密码:```cmdmysql -u root-p```输入临时密码后,执行:```sqlALTERUSER 'root'@'localhost'IDENTIFIED BY'你的新密码';```如果上述步骤中重新初始化仍然失败(即第4步出错),则考虑以下可能:-权限问题:确保运行MySQL服务的账户(通常是NETWORK SERVICE)对数据目录(D:\MySQLServer8.0\data)有完全控制权限。-磁盘空间不足:检查磁盘空间。-磁盘错误:运行chkdsk检查磁盘错误。-配置文件问题:检查my.ini配置文件,确保数据目录(datadir)和日志文件路径正确且可访问。另外,从日志中看到有尝试使用MySQL5.7的日志,但主要问题在8.0版本上。因此,我们集中解决8.0的问题。如果重新初始化成功,但启动服务时仍然失败,请查看错误日志(数据目录下以.err结尾的文件)获取更详细的信息。由于日志中多次出现数据目录非空和redolog创建失败,因此清理数据目录并重新初始化是最直接的解决方案。以下是具体步骤的代码示例:</think>### 解决MySQL启动失败问题分析 根据您提供的日志,核心问题是 **InnoDB无法创建redo日志文件**,错误信息为: ``` [ERROR] [InnoDB] Cannot create redo log files because data files are corrupt or the database was not shut down cleanly after creating the data files. ``` 这表明您的MySQL数据目录存在严重损坏,需要彻底重建。以下是完整解决方案: --- ### 解决方案:完全重建数据目录 #### 步骤1:停止MySQL服务 ```cmd net stop MySQL80 ``` #### 步骤2:备份并删除原数据目录 ```cmd :: 备份原数据(重要!) xcopy /E "D:\MySQL Server 8.0\Data" "D:\MySQL_Backup_%date:~0,4%%date:~5,2%%date:~8,2%" /I /H /K /Y :: 删除整个数据目录 rmdir /S /Q "D:\MySQL Server 8.0\Data" ``` #### 步骤3:重建数据目录结构 ```cmd mkdir "D:\MySQL Server 8.0\Data" ``` #### 步骤4:重新初始化MySQL ```cmd cd "D:\MySQL Server 8.0\bin" mysqld --initialize-insecure --user=mysql --basedir="D:\MySQL Server 8.0" --datadir="D:\MySQL Server 8.0\Data" ``` **注意**:`--initialize-insecure`会创建空密码的root账户,生产环境建议使用`--initialize --console`记录随机密码 #### 步骤5:修改配置文件(my.ini) 确保`my.ini`包含: ```ini [mysqld] basedir=D:/MySQL Server 8.0 datadir=D:/MySQL Server 8.0/Data port=3306 default_authentication_plugin=mysql_native_password ``` #### 步骤6:重新注册并启动服务 ```cmd mysqld --remove mysqld --install MySQL80 --defaults-file="D:\MySQL Server 8.0\my.ini" net start MySQL80 ``` --- ### 关键错误分析 1. **数据文件损坏**: - 日志多次出现`data files are corrupt`错误 - 原因:非正常关机/磁盘错误/版本升级失败 2. **初始化冲突**: ``` --initialize specified but the data directory has files in it. Aborting. ``` - 解决方案:必须清空数据目录才能重新初始化 3. **版本混淆**: - 日志显示同时存在MySQL 5.7和8.0的启动尝试 - 确保环境变量和服务指向正确的8.0安装路径 --- ### 高级故障排查 如果上述步骤仍失败,尝试手动创建redo日志: ```cmd mysqld --no-defaults --initialize-insecure --innodb-buffer-pool-size=128M --innodb-log-file-size=48M ``` **参数说明**: - `--innodb-log-file-size`:减小redo日志大小(默认48M) - `--innodb-buffer-pool-size`:降低内存占用(128M) --- ### 预防措施 1. **定期备份**: ```cmd mysqldump -u root -p --all-databases > full_backup.sql ``` 2. **配置自动恢复**: 在`my.ini`添加: ```ini [mysqld] innodb_force_recovery = 1 # 尝试级别1~6的恢复 ``` 3. **磁盘检查**: ```cmd chkdsk D: /f /r ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值