不懂?没有人会嘲笑你;装懂?人人鄙视你;不懂,先研究;再不懂,就问吧!

服务器断电,重启后 Mysql 无法开启,报错[FAIL..] The server quit without updating PID file (/tmp/mysqld.pid). … failed!

Linux相关 xjmroots 1029℃ 0评论

试试下面机种方法吧

查看数据库错误日志:内容如下、如果你日志也出现这样的报错、那么就很好解决了

31 InnoDB: To fix the problem and start mysqld:

32 InnoDB: 1) If there is a permission problem in the file and mysqld cannot
33 InnoDB: open the file, you should modify the permissions.
34 InnoDB: 2) If the table is not needed, or you can restore it from a backup,
35 InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
36 InnoDB: crash recovery and ignore that table.
37 InnoDB: 3) If the file system or the disk is broken, and you cannot remove
38 InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
39 InnoDB: and force InnoDB to continue crash recovery here.
40 151113 09:58:00 mysqld_safe mysqld from pid file /tmp/mysqld.pid ended
41 151113 10:00:27 mysqld_safe Starting mysqld daemon with databases from /home/mysql/data

日志里面其实已经给出了解决方法

报错里面给出来3种造成启动不成功的原因

1)打开这个文件没权限

2)你需要删除 .idb文件

3)你需要在my.cnf 里面设置   innodb_force_recovery=1

这3种方法都可以试试、一般都可以解决

如果是第三种方法解决的、记得启动成功后把  innodb_force_recovery 注释掉、不然会导致PHP无法查询数据库

转载请注明:家明的博客 » 服务器断电,重启后 Mysql 无法开启,报错[FAIL..] The server quit without updating PID file (/tmp/mysqld.pid). … failed!

喜欢 (3)or分享 (0)
发表我的评论
取消评论
表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址