电脑死机重启后,再开机打开 xampp
, mysql
就无法启动了。
xampp上的错误日志
09:41:15 [mysql] Error: MySQL shutdown unexpectedly.
09:41:15 [mysql] This may be due to a blocked port, missing dependencies,
09:41:15 [mysql] improper privileges, a crash, or a shutdown by another method.
09:41:15 [mysql] Press the Logs button to view error logs and check
09:41:15 [mysql] the Windows Event Viewer for more clues
09:41:15 [mysql] If you need more help, copy and post this
09:41:15 [mysql] entire log window on the forums
大概意思是mysql启动失败,提示可能是端口被占用,缺少依赖,权限问题,电脑死机或者其他任何导致关机都可能是原因,等于啥都没说,端口确认是没有占用的,我这个情况显然是因为之前的电脑死机导致的。
提示查看错误日志。下面查看mysql的启动错误日志。
mysql启动日志
2020-10-22 9:19:09 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2020-10-22 9:19:09 0 [Note] InnoDB: Uses event mutexes
2020-10-22 9:19:09 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-10-22 9:19:09 0 [Note] InnoDB: Number of pools: 1
2020-10-22 9:19:09 0 [Note] InnoDB: Using SSE2 crc32 instructions
2020-10-22 9:19:09 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2020-10-22 9:19:09 0 [Note] InnoDB: Completed initialization of buffer pool
2020-10-22 9:19:10 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-10-22 9:19:10 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-10-22 9:19:10 0 [Note] InnoDB: Setting file 'D:xampp72mysqldataibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-10-22 9:19:10 0 [Note] InnoDB: File 'D:xampp72mysqldataibtmp1' size is now 12 MB.
2020-10-22 9:19:10 0 [Note] InnoDB: Waiting for purge to start
2020-10-22 9:19:10 0 [Note] InnoDB: 10.4.11 started; log sequence number 18007704893; transaction id 1827990
2020-10-22 9:19:10 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-10-22 9:19:10 0 [Note] InnoDB: Loading buffer pool(s) from D:xampp72mysqldataib_buffer_pool
2020-10-22 9:19:10 0 [Note] Server socket created on IP: '::'.
从这上面看不出来到底哪里报错了,没有什么大问题。
进入到 xampp
下的 mysql
的 bin
文件夹,我这边是 D:xampp72mysqlbin
运行 mysqld --console
。
通过mysqld –console的输出来查看
看到很多类似的错误信息:
尝试解决
首先备份一下 mysql/data
文件夹(这里面包含所有的数据库和记录等等)到 mysql/data_old
。
经过各种尝试,包括修改 my.ini
的 innodb_force_recovery
配置,无效。
最后的解决办法,,然后从 data/backup
中复制 multi-master.info
文件到 mysql/data
,重新启动 mysql
成功了。
如果这个办法不能解决你的清空,可以尝试将 data/backup
里的文件全部复制到 mysql/data
覆盖,然后从备份文件夹 mysql/data_old
中复制 ibdata1
文件和数据库同名文件夹到 mysql/data
,试试看是不是可以启动 mysql
了。