XAMPP mysql无法启动

XAMPP 版本3.2.4

之前就碰到过一次,直接重装xampp,问题解决。

今天又碰到了,

15:48:46  [mysql] 	Error: MySQL shutdown unexpectedly.
15:48:46  [mysql] 	This may be due to a blocked port, missing dependencies, 
15:48:46  [mysql] 	improper privileges, a crash, or a shutdown by another method.
15:48:46  [mysql] 	Press the Logs button to view error logs and check
15:48:46  [mysql] 	the Windows Event Viewer for more clues
15:48:46  [mysql] 	If you need more help, copy and post this
15:48:46  [mysql] 	entire log window on the forums

查看mysql_error.log

2021-08-05 15:06:57 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2021-08-05 15:06:57 0 [Note] InnoDB: Uses event mutexes
2021-08-05 15:06:57 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-08-05 15:06:57 0 [Note] InnoDB: Number of pools: 1
2021-08-05 15:06:57 0 [Note] InnoDB: Using SSE2 crc32 instructions
2021-08-05 15:06:57 0 [Note] InnoDB: Initializing buffer pool, total size = 1G, instances = 1, chunk size = 128M
2021-08-05 15:06:57 0 [Note] InnoDB: Completed initialization of buffer pool
2021-08-05 15:06:57 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2021-08-05 15:06:57 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-08-05 15:06:57 0 [Note] InnoDB: Setting file 'E:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-08-05 15:06:57 0 [Note] InnoDB: File 'E:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2021-08-05 15:06:57 0 [Note] InnoDB: Waiting for purge to start
2021-08-05 15:06:57 0 [Note] InnoDB: 10.4.18 started; log sequence number 300378; transaction id 8
2021-08-05 15:06:57 0 [Note] InnoDB: Loading buffer pool(s) from E:\xampp\mysql\data\ib_buffer_pool
2021-08-05 15:06:57 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-08-05 15:06:57 0 [Note] InnoDB: Buffer pool(s) load completed at 210805 15:06:57
2021-08-05 15:06:57 0 [Note] Server socket created on IP: '::'.
InnoDB: using atomic writes.

按照https://www.cnblogs.com/4php/p/4122210.html删除文件后,依然不能启动。

在xampp面板上重装mysql,又出现如下报错:

2021-08-05 15:07:42 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2021-08-05 15:07:42 0 [Note] InnoDB: Uses event mutexes
2021-08-05 15:07:42 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-08-05 15:07:42 0 [Note] InnoDB: Number of pools: 1
2021-08-05 15:07:42 0 [Note] InnoDB: Using SSE2 crc32 instructions
2021-08-05 15:07:42 0 [Note] InnoDB: Initializing buffer pool, total size = 1G, instances = 1, chunk size = 128M
2021-08-05 15:07:43 0 [Note] InnoDB: Completed initialization of buffer pool
2021-08-05 15:07:43 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2021-08-05 15:07:43 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-08-05 15:07:43 0 [Note] InnoDB: Setting file 'E:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-08-05 15:07:43 0 [Note] InnoDB: File 'E:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2021-08-05 15:07:43 0 [Note] InnoDB: Waiting for purge to start
2021-08-05 15:07:43 0 [Note] InnoDB: 10.4.18 started; log sequence number 300405; transaction id 8
2021-08-05 15:07:43 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-08-05 15:07:43 0 [Note] InnoDB: Loading buffer pool(s) from E:\xampp\mysql\data\ib_buffer_pool
2021-08-05 15:07:43 0 [Note] InnoDB: Buffer pool(s) load completed at 210805 15:07:43
2021-08-05 15:07:43 0 [Note] Server socket created on IP: '::'.
2021-08-05 15:07:43 0 [ERROR] mysqld.exe: Table '.\mysql\db' is marked as crashed and last (automatic?) repair failed
2021-08-05 15:07:43 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table '.\mysql\db' is marked as crashed and last (automatic?) repair failed
2021-08-05 15:07:43 0 [ERROR] Aborting
InnoDB: using atomic writes.

直接把db文件夹标为crash,并且修复失败。

最后按照https://stackoverflow.com/questions/56847804/xampp-mysql-service-crash-after-reboot的方法:

  1. 点击xampp面板上的Shell按钮进入命令框,输入命令:
    mysqld –-console –-skip-grant-tables –-skip-external-locking
  2. 保持上一个窗口不关闭,重新在面板上点开一个Shell,输入指令:
    mysqlcheck -r --databases mysql --use-frm

    等命令窗口不再变化,再关闭命令窗口,重新启动xampp,问题解决。

到现在,已经可以正常打开mysql server 了。

如果出现“table *** doesn't exist in engine”,在db文件夹中发现文件都在。这时候需要在回收站中找到删除的ibdata1文件,还原ibdata1,记得是最早删除的那个。

还原后,重启mysql,打开navicate,终于回来了。

转载请注明出处!

  • 6
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值