打印

[MySQL] InnoDB数据库进程无法启动了

InnoDB数据库进程无法启动了

Starting MySQL. ERROR! The server quit without updating PID file (/www/data/twk2.pid).系统:centos6.9   2核4G安装的lnmp1.5  数据库引擎默认的是InnoDB,今天手欠发现产生很多错误日志,就点开一个wordpress网站的数据库,点修复报错,然后想着优化一下,就点了一下优化,然后phpmyadmin的root账户直接就从控制面板退出了,后面再登录phpmyadmin就提示Warning: mysqli::mysqli(): (HY000/2002): No such file or directory重启mysql,就提示




按照咱们论坛的方法修改了数据库目录的权限,重启依然不起作用。
错误日志文件太大了,我直把从新的部分,也是重复的部分保留了,麻烦军哥有空帮看看这是什么情况?以前也出现过这种情况,重装数据库后,原来InnoDB类型的数据库导入失败,直接把文件拷贝过去,在phpmyadmin里面看数据库,显示不出来那些数据库文件。
附件: 您所在的用户组无法下载或查看附件

TOP

引用:
2019-03-13T04:43:11.683455Z 0 [ERROR] InnoDB: Operating system error number 2 in a file operation.
2019-03-13T04:43:11.683489Z 0 [ERROR] InnoDB: The error means the system cannot find the path specified.
2019-03-13T04:43:11.683494Z 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2019-03-13T04:43:11.683500Z 0 [ERROR] InnoDB: Cannot open datafile for read-only: './mylshuo_com/wp1_commentmeta.ibd' OS error: 71
2019-03-13T04:43:11.683505Z 0 [ERROR] InnoDB: Operating system error number 2 in a file operation.
2019-03-13T04:43:11.683509Z 0 [ERROR] InnoDB: The error means the system cannot find the path specified.
2019-03-13T04:43:11.683514Z 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2019-03-13T04:43:11.683520Z 0 [ERROR] InnoDB: Could not find a valid tablespace file for `mylshuo_com/wp1_commentmeta`. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2019-03-13T04:43:11.683527Z 0 [Warning] InnoDB: Ignoring tablespace `mylshuo_com/wp1_commentmeta` because it could not be opened.
2019-03-13T04:43:11.683547Z 0 [ERROR] InnoDB: Operating system error number 2 in a file operation.
2019-03-13T04:43:11.683552Z 0 [ERROR] InnoDB: The error means the system cannot find the path specified.
2019-03-13T04:43:11.683557Z 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2019-03-13T04:43:11.683562Z 0 [ERROR] InnoDB: Cannot open datafile for read-only: './mylshuo_com/wp1_comments.ibd' OS error: 71
2019-03-13T04:43:11.683566Z 0 [ERROR] InnoDB: Operating system error number 2 in a file operation.
2019-03-13T04:43:11.683570Z 0 [ERROR] InnoDB: The error means the system cannot find the path specified.
2019-03-13T04:43:11.683585Z 0 [ERROR] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2019-03-13T04:43:11.683591Z 0 [ERROR] InnoDB: Could not find a valid tablespace file for `mylshuo_com/wp1_comments`. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
innodb是不能直接拷贝目录的,拷贝了也没法用,只能是导出数据库才行

LNMP付费问题排查/LNMP技术支持/Paypal信用卡代付/代购VPS,域名,软件等 QQ 503228080 旺旺 lzhenbao
军哥淘宝店铺
QQ/旺旺仅提供代购及付费代维/问题解决等服务,其他不回复!LNMP相关问题请在本论坛发帖,提问前先搜索,按https://bbs.vpser.net/thread-2555-1-1.html 要求反馈问题!

TOP

回复 2# 的帖子

嗯 ,谢谢军哥,已经解决了,这种问题遇到的次数还是挺多的,之前也遇到过,后面把服务器重装了,innobd数据库类型的数据全废了,好在没几个网站,这次从网上找修复Starting MySQL. ERROR! The server quit without updating PID file (/www/data/twk2.pid)  的方法,找了很多但几乎没用,最好找把InnoDB类型的数据库导出方法才找到了,步骤:整体备份原来的数据库文件夹,删除数据库文件夹下面的ib_logfile0和ib_logfile1文件夹,然后修改数据库配置文件my.cnf,在[mysqld] 下面加入innodb_force_recovery=4,保存,连接ssh重启数据库服务,就可以启动起来了,现在登录phpmyadmin可以登录了,但这不是长久解决问题的办法,于是导出需要的innodb类型数据库文件,再导入到其它服务器上就可以读出来了。如果你卸载了原来的数据库重装了数据库,那只需要备份新数据库下面的ibdata1,拷入原来备份的数据库下面的ibdata1文件到新的数据库下面,按上面的步骤重新操作一次就可以了,导出数据库文件后,把备份的新安装的数据库下面的ibdata1文件恢复回去,删除ib_logfile0和ib_logfile1文件和数据库配置文件my.cnf里面之前加入的innodb_force_recovery=4,重启服务器导入你前面导出的.sql数据库文件就可以了。网上 其他那些修改数据库目录权限,把localhost修改成127.0.0.1那些方法试了都不起作用,修改后数据库服务该启不来还是启动不起来。

TOP