为你介绍xampp运行MySQL shutdown unexpectedly的解决方法

为你介绍xampp运行MySQL shutdown unexpectedly的解决方法,第1张

方法/步骤

1、故障描述:

12:15:46

[mysql]

Attempting

to

start

MySQL

app...

12:15:47

[mysql]

Status

change

detected:

running

12:15:47

[mysql]

Status

change

detected:

stopped

12:15:47

[mysql]

Error:

MySQL

shutdown

unexpectedly.

12:15:47

[mysql]

This

may

be

due

to

a

blocked

port,

missing

dependencies,

12:15:47

[mysql]

improper

privileges,

a

crash,

or

a

shutdown

by

another

method.

12:15:47

[mysql]

Press

the

Logs

button

to

view

error

logs

and

check

12:15:47

[mysql]

the

Windows

Event

Viewer

for

more

clues

12:15:47

[mysql]

If

you

need

more

help,

copy

and

post

this

12:15:47

[mysql]

entire

log

window

on

the

forums

2、故障说明:

在我们启动xampp时,发现Apache可以正常启动;而MySQL却不能正常运行。我们称它为MySQL意外关机。这是由于端口被占用,或者缺少运行特权,崩溃而导致MySQL数据库意外关闭。

3、解决办法:

在xampp软件界面找到MySQL组件,点击其组件下的config按钮,打开mysql配置文件(位置如下图);

4、在mysql配置文件内搜索到[mysqld]所在行,在其下方插入

[mysqld]

innodb_force_recovery

=

4

保存后关闭记事本(位置如下图);

5、这时重新运行MySQL组件,是不是发现问题已经解决了呢!

13:00:41

[mysql]

Attempting

to

start

MySQL

app...

13:00:41

[mysql]

Status

change

detected:

running

6、快去你的本地WordPress小站看看吧。

这个说明mysql的索引文件出了问题,对于这个问题可以使用mysqlcheck工具检查表的状态,它有一个-r参数,可以用来修复表,通过修复索引,可以大概率解决启动失败问题。

mysql的表有三个文件,分别是frm,myd,myi这三个文件。

frm是表描述文件。

myd是数据记录。

myi是索引。

所以你可以从一个好的mysql数据库中把遇到问题的表替换掉。然后重启mysql试试。

今天运行XAMPP启动MySQL数据库时出现错误:

21:37:31 [mysql] Status change detected: stopped

21:37:31 [mysql] Error: MySQL shutdown unexpectedly.

21:37:31 [mysql] This may be due to a blocked port, missing dependencies,

21:37:31 [mysql] improper privileges, a crash, or a shutdown by another method.

21:37:31 [mysql] Press the Logs button to view error logs and check

21:37:31 [mysql] the Windows Event Viewer for more clues

21:37:31 [mysql] If you need more help, copy and post this

21:37:31 [mysql] entire log window on the forums

有遇到这类问题的朋友可以试试小编的方法,反正我是解决了。

打开你的xampp安装目录,这里小编把它安装在D:\Program Files\xampp目录。

下拉鼠标,找到Mysql文件夹,这里就是你的本地MySQL数据库,点击打开。

步骤阅读

继续打开data文件夹,data一般是指保存数据的文件夹,也可能是软件生成的临时文件夹。

这里有个文件名为 ibdata1 的文件 ,ibdata就是用来储存文件的数据的。这里我们把它删除掉。

重新运行XAMPP程序,启动MySQL数据库。

系统提示:Status change detected: running说明MySQL数据库启动成功。

再次进入D:\Program Files\xampp\mysql\data文件目录我们可以看到,系统又重新生成了一个 ibdata1 文件。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/7496157.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-06
下一篇 2023-04-06

发表评论

登录后才能评论

评论列表(0条)

保存